From dd447258465473c4b5bc7525cd24a026d2089928 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Sun, 18 Jan 2015 21:42:17 +0200 Subject: init script: rely on --background, --pidfile during stop() --- res/debian/rhizi.init | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/res/debian/rhizi.init b/res/debian/rhizi.init index 0d925347..c8c6870d 100644 --- a/res/debian/rhizi.init +++ b/res/debian/rhizi.init @@ -14,9 +14,8 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="rhizi-server" -NAME=rhizi-server +NAME=rhizi DAEMON=/srv/www/rhizi/rhizi.net/bin/rz_server.py -DAEMON_ARGS="--config-dir=/etc/rhizi" PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USERNAME=www-data @@ -48,10 +47,10 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --quiet --pidfile $PIDFILE $ARGS__START_STOP_DAEMON --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ - $DAEMON_ARGS \ + start-stop-daemon --start --quiet --pidfile $PIDFILE $ARGS__START_STOP_DAEMON --exec $DAEMON -- \ + $ARGS__DAEMON \ || return 2 } @@ -65,7 +64,7 @@ do_stop() # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 -- cgit v1.3.1