Patchwork [dupdate] init-script dupdate.sh: fix restart

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

Comments

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

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

/Esben

Patch

diff --git a/src/dupdate.sh b/src/dupdate.sh
index 57fd427..7dc43af 100755
--- a/src/dupdate.sh
+++ b/src/dupdate.sh
@@ -5,7 +5,7 @@  DESC="Firmware update daemon"
 DIR="/tmp/fwupdates"
 EXEFILE="run"
 ARGS="$DIR -x $EXEFILE -l"
-
+PIDFILE=/var/run/dupdate.pid
 test -f $DAEMON || exit 0
 
 set -e
@@ -15,12 +15,12 @@  case "$1" in
         echo -n "starting $DESC: $NAME... "
 	[ -d $DIR ] && rm -rf $DIR
 	mkdir -p $DIR
-	start-stop-daemon -S -n $NAME -a $DAEMON -- $ARGS
+	start-stop-daemon -S -m -p $PIDFILE -a $DAEMON -- $ARGS
 	echo "done."
 	;;
     stop)
         echo -n "stopping $DESC: $NAME... "
-	start-stop-daemon -K -n $NAME
+	start-stop-daemon -K -p $PIDFILE
 	echo "done."
 	;;
     restart)