From ecbb4a514177946a43e77fc90e823f845c6dafbf Mon Sep 17 00:00:00 2001 From: Jon Bonilla Date: Sat, 19 Mar 2011 07:55:58 +0000 Subject: [PATCH] remove pidfile on stop. This makes "status" check on stop to return lsb compliant value --- debian/mediator.init | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/mediator.init b/debian/mediator.init index 9cf351c..efedde5 100755 --- a/debian/mediator.init +++ b/debian/mediator.init @@ -67,6 +67,10 @@ case "$1" in echo -n "Stopping $DESC: $NAME" start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ --exec $DAEMON + if [ "$?" -ne 0 ]; then + return $? + fi + rm -f $PIDFILE log_end_msg $? ;; restart|force-reload) @@ -74,10 +78,14 @@ case "$1" in echo -n "Restarting $DESC: $NAME" start-stop-daemon --oknodo --stop --quiet --pidfile \ $PIDFILE --exec $DAEMON + if [ "$?" -ne 0 ]; then + return $? + fi + rm -f $PIDFILE sleep 1 start-stop-daemon --start --quiet --pidfile \ $PIDFILE --exec $DAEMON -- $OPTIONS - echo "." + log_end_msg $? ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?