Patchwork [dscan] init-script dscand.sh: fix restart option

login
register
mail settings
Submitter Jacob Kjaergaard
Date Oct. 3, 2013, 11:41 a.m.
Message ID <1380800493-16670-1-git-send-email-jabk@prevas.dk>
Download mbox | patch
Permalink /patch/280271/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Jacob Kjaergaard - Oct. 3, 2013, 11:41 a.m.
From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk>

---
 src/dscand.sh.in |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Esben Haabendal - Oct. 14, 2013, 2:16 p.m.
Merged to master, thanks.

/Esben

Patch

diff --git a/src/dscand.sh.in b/src/dscand.sh.in
index 4527f5e..829bfea 100755
--- a/src/dscand.sh.in
+++ b/src/dscand.sh.in
@@ -3,6 +3,7 @@  DAEMON=@BINDIR@/dscand
 NAME=dscand
 DESC="dscan daemon"
 ID="controller"
+PIDFILE=/var/run/dscand.pid
 
 test -f $DAEMON || exit 0
 
@@ -11,12 +12,12 @@  set -e
 case "$1" in
     start)
 	echo -n "starting $DESC: $NAME... "
-	start-stop-daemon -S -n $NAME -a $DAEMON -- --daemon --id="$ID"
+	start-stop-daemon -S -m -p $PIDFLE -a $DAEMON -- --daemon --id="$ID"
 	echo "done."
 	;;
     stop)
 	echo -n "stopping $DESC: $NAME... "
-	start-stop-daemon -K -n $NAME
+	start-stop-daemon -K -p $PIDFILE
 	echo "done."
 	;;
     restart)