From: Gunnar Beutner Date: Tue, 2 Sep 2014 11:48:48 +0000 (+0200) Subject: Init script: Check whether the PID file exists X-Git-Tag: v2.1.1~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ae1f4273cbe5a6eaa8fb8d82982b87af0705868;p=icinga2 Init script: Check whether the PID file exists fixes #7047 --- diff --git a/etc/initsystem/icinga2.init.d.cmake b/etc/initsystem/icinga2.init.d.cmake index de5679c7a..ad61fb276 100644 --- a/etc/initsystem/icinga2.init.d.cmake +++ b/etc/initsystem/icinga2.init.d.cmake @@ -65,7 +65,7 @@ stop() { if [ "x$1" = "xnofail" ]; then return else - exit 1 + exit 7 fi fi @@ -94,6 +94,10 @@ stop() { reload() { printf "Reloading Icinga 2: " + if [ ! -e $ICINGA2_PID_FILE ]; then + exit 7 + fi + pid=`cat $ICINGA2_PID_FILE` if kill -HUP $pid >/dev/null 2>&1; then echo "Done" @@ -131,6 +135,11 @@ checkconfig() { status() { printf "Icinga 2 status: " + if [ ! -e $ICINGA2_PID_FILE ]; then + echo "Not running" + exit 7 + fi + pid=`cat $ICINGA2_PID_FILE` if kill -CHLD $pid >/dev/null 2>&1; then echo "Running"