Make sure that the restart action doesn't fail when the PID file isn't there.

This commit is contained in:
Gunnar Beutner 2013-10-14 18:02:37 +02:00
parent a514d0d97f
commit 8d4e7bc002
1 changed files with 7 additions and 3 deletions

View File

@ -75,8 +75,12 @@ stop() {
printf "Stopping Icinga 2: "
if [ ! -e $ICINGA2_PID_FILE ]; then
echo "The PID file '$ICINGA2_PID_FILE' does not exist."
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)