From 126a738e95d9be5df9e3f8b27bf901c959d33b8a Mon Sep 17 00:00:00 2001 From: Jon Bonilla Date: Mon, 28 Feb 2011 16:18:54 +0000 Subject: [PATCH] change mediator init script to make it lsb compliant (does not work as mediator stop does not remove pid file) --- debian/mediator.init | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/mediator.init b/debian/mediator.init index ee9071a..9cf351c 100755 --- a/debian/mediator.init +++ b/debian/mediator.init @@ -28,6 +28,9 @@ fi set -e +. /lib/lsb/init-functions + + OPTIONS="" [ -z "$PIDFILE" ] || OPTIONS="$OPTIONS -D $PIDFILE" @@ -56,15 +59,15 @@ case "$1" in start) echo -n "Starting $DESC: $NAME" - start-stop-daemon --start --quiet --pidfile $PIDFILE \ + start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE \ --exec $DAEMON -- $OPTIONS || echo -n " already running" - echo "." + log_end_msg $? ;; stop) echo -n "Stopping $DESC: $NAME" start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ --exec $DAEMON - echo "." + log_end_msg $? ;; restart|force-reload) @@ -76,8 +79,11 @@ case "$1" in $PIDFILE --exec $DAEMON -- $OPTIONS echo "." ;; + status) + status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? + ;; *) - echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac