From 8d4e7bc002e7f1536255d3c713a1055a794d7f63 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 14 Oct 2013 18:02:37 +0200 Subject: [PATCH] Make sure that the restart action doesn't fail when the PID file isn't there. --- etc/init.d/icinga2.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/init.d/icinga2.in b/etc/init.d/icinga2.in index 36bd034ad..723c75725 100644 --- a/etc/init.d/icinga2.in +++ b/etc/init.d/icinga2.in @@ -75,7 +75,11 @@ stop() { printf "Stopping Icinga 2: " if [ ! -e $ICINGA2_PID_FILE ]; then echo "The PID file '$ICINGA2_PID_FILE' does not exist." - exit 1 + if [ "x$1" = "xnofail" ]; then + return + else + exit 1 + fi fi pid=`cat $ICINGA2_PID_FILE` @@ -145,10 +149,10 @@ case "$1" in stop ;; status) - status FOO + status ;; restart|condrestart) - stop + stop nofail start ;; reload)