From 27811a48bc63b05973f537ade7e09d5c10a2dde6 Mon Sep 17 00:00:00 2001 From: Sam Pearson Date: Mon, 1 Oct 2018 17:10:29 +0100 Subject: Add check for PIDFILE to init script stop action The install script calls a service restart at build, this failed if the stop action in the init script doesn't check for the existence of the PIDFILE first, so check. --- conf/sysvinit.example | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/sysvinit.example b/conf/sysvinit.example index 3c457dd64..6b47c4371 100755 --- a/conf/sysvinit.example +++ b/conf/sysvinit.example @@ -30,7 +30,11 @@ start_daemon() { } stop_daemon() { - kill -TERM `cat $PIDFILE` + if [ -e "$PIDFILE" ]; then + kill -TERM `cat $PIDFILE` + else + echo "No $PIDFILE found, skipping KILL." + fi } case "$1" in -- cgit v1.2.3