diff mbox

[base,3/3] busybox: fixup restart option in initscripts

Message ID 1380873445-546-3-git-send-email-jabk@prevas.dk
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

Jacob Kjaergaard Oct. 4, 2013, 7:57 a.m. UTC
From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk>

---
 recipes/busybox/files/busybox-crond  |    5 +++--
 recipes/busybox/files/busybox-httpd  |    5 +++--
 recipes/busybox/files/busybox-udhcpd |    5 +++--
 3 files changed, 9 insertions(+), 6 deletions(-)

Comments

Esben Haabendal Oct. 14, 2013, 2:30 p.m. UTC | #1
Merged to master, thanks.

/Esben
diff mbox

Patch

diff --git a/recipes/busybox/files/busybox-crond b/recipes/busybox/files/busybox-crond
index 9c4a218..6d68ff3 100755
--- a/recipes/busybox/files/busybox-crond
+++ b/recipes/busybox/files/busybox-crond
@@ -3,6 +3,7 @@  DAEMON=/usr/sbin/crond
 NAME=crond
 DESC="Busybox Periodic Command Scheduler"
 ARGS=""
+PIDFILE=/var/run/busybox-crond.pid
 
 test -f $DAEMON || exit 0
 
@@ -12,12 +13,12 @@  case "$1" in
     start)
 	splash_progress PLACEHOLDER
         echo -n "starting $DESC: $NAME... "
-	start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	start-stop-daemon -S -b -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)
diff --git a/recipes/busybox/files/busybox-httpd b/recipes/busybox/files/busybox-httpd
index 9632d6b..d82b635 100755
--- a/recipes/busybox/files/busybox-httpd
+++ b/recipes/busybox/files/busybox-httpd
@@ -4,6 +4,7 @@  NAME=httpd
 DESC="Busybox HTTP Daemon"
 HTTPROOT="/srv/www"
 ARGS="-h $HTTPROOT"
+PIDFILE=/var/run/httpd.pid
 
 test -f $DAEMON || exit 0
 
@@ -17,12 +18,12 @@  case "$1" in
 		exit 1
 	fi
 	splash_progress PLACEHOLDER
-	start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	start-stop-daemon -S -b -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)
diff --git a/recipes/busybox/files/busybox-udhcpd b/recipes/busybox/files/busybox-udhcpd
index c43903e..203bd13 100755
--- a/recipes/busybox/files/busybox-udhcpd
+++ b/recipes/busybox/files/busybox-udhcpd
@@ -3,6 +3,7 @@  DAEMON=/usr/sbin/udhcpd
 NAME=udhcpd
 DESC="Busybox UDHCP Server"
 ARGS="/etc/udhcpd.conf"
+PIDFILE=/var/run/udhcpd.pid
 
 test -f $DAEMON || exit 1
 
@@ -15,12 +16,12 @@  case "$1" in
 		echo "error: /etc/udhcpd.conf is missing."
 		exit 1
 	fi
-	/sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	/sbin/start-stop-daemon -S -b -m -p $PIDFILE -a $DAEMON -- $ARGS
 	echo "done."
 	;;
     stop)
         echo -n "stopping $DESC: $NAME... "
-	/sbin/start-stop-daemon -K -n $NAME
+	/sbin/start-stop-daemon -K -p $PIDFILE
 	echo "done."
 	;;
     restart)