From b9b4351c1d319454b24b41acf78425c12f9fda6e Mon Sep 17 00:00:00 2001 From: Jan Losinski Date: Sat, 6 Sep 2014 19:33:53 +0200 Subject: [PATCH] init script fixed (cherry picked from commit 646f6076b5fae338a432a0b319ff640946047cd9) --- debian/init.d | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/debian/init.d b/debian/init.d index 3c3f18c..18bb3b0 100644 --- a/debian/init.d +++ b/debian/init.d @@ -24,32 +24,32 @@ set -e case "$1" in start) - echo -n "Starting $DESC: " - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --chuid xerxes -b --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." - ;; - stop) - echo -n "Stopping $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON - echo "$NAME." - ;; + echo -n "Starting $DESC: " + start-stop-daemon --start --make-pidfile --pidfile /var/run/$NAME.pid --chuid xerxes -b --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid + echo "$NAME." + ;; force-reload) - # check wether $DAEMON is running. If so, restart - start-stop-daemon --stop --test --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON && $0 restart \ - || exit 0 - ;; + # check wether $DAEMON is running. If so, restart + start-stop-daemon --stop --test --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON && $0 restart \ + || exit 0 + ;; restart) echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid --exec $DAEMON - sleep 1 - start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid --chuid xerxes -b --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid + sleep 1 + start-stop-daemon --start --quiet --make-pidfile --pidfile /var/run/$NAME.pid --chuid xerxes -b --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; esac exit 0