Use consistent method to kill process in s6 finish script

If the process does not exist, the error message of `kill` command is a
little bit confusing:

`kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]`

Using `killall` in `/s6/debian-root/etc/services.d/pihole-FTL/finish` to
kill the process, like what we do in `cron/finish` & `lighttpd/finish`,
will make the usage in this project more consistent, and also, the
command `killall` will provide better & friendly output, like:

`pihole-FTL: no process found`

Close #986, cc #973

Signed-off-by: Peter Dave Hello <hsu@peterdavehello.org>
This commit is contained in:
Peter Dave Hello 2022-01-17 19:42:18 +08:00
parent 0a20ef8955
commit b29ac1ec18
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
s6-echo "Stopping pihole-FTL"
kill -15 $(pgrep pihole-FTL)
killall -15 pihole-FTL