From b29ac1ec187e300ef7d8f09e40a01d1d3e84aecb Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 17 Jan 2022 19:42:18 +0800 Subject: [PATCH] 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 --- s6/debian-root/etc/services.d/pihole-FTL/finish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s6/debian-root/etc/services.d/pihole-FTL/finish b/s6/debian-root/etc/services.d/pihole-FTL/finish index 6beaaf5..4ed219a 100644 --- a/s6/debian-root/etc/services.d/pihole-FTL/finish +++ b/s6/debian-root/etc/services.d/pihole-FTL/finish @@ -1,4 +1,4 @@ #!/usr/bin/with-contenv bash s6-echo "Stopping pihole-FTL" -kill -15 $(pgrep pihole-FTL) +killall -15 pihole-FTL