From: Carlos Santos Date: Thu, 7 Jun 2018 01:36:41 +0000 (-0300) Subject: netplug: prevent starting multiple instances of netplugd X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c6a5bdd3ed94f97afe2db9123d7117f85f654ce;p=buildroot.git netplug: prevent starting multiple instances of netplugd Executing "/etc/init.d/S29netplug start" multiple times resulted in multiple instances of netplugd. Pass "-p /var/run/netplug.pid" to netplugd, so it creates the PID file that start-stop-daemon needs to know that netplugd is already running. Also use the pid file to stop netplugd, instead of the daemon name. Fixes https://bugs.busybox.net/show_bug.cgi?id=10661 Reported-by: Joachim Krueger Signed-off-by: Carlos Santos Signed-off-by: Thomas Petazzoni --- diff --git a/package/netplug/S29netplug b/package/netplug/S29netplug index 04cac9f07c..66459061b3 100755 --- a/package/netplug/S29netplug +++ b/package/netplug/S29netplug @@ -41,7 +41,7 @@ case "$1" in start) # Start daemon. printf "Starting network plug daemon: " - start-stop-daemon -S -q -p /var/run/netplugd.pid -x /sbin/netplugd ${NETPLUGDARGS} + start-stop-daemon -S -q -x /sbin/netplugd -- -p /var/run/netplugd.pid ${NETPLUGDARGS} RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd @@ -49,7 +49,7 @@ case "$1" in stop) # Stop daemon. printf "Shutting down network plug daemon: " - start-stop-daemon -K -n netplugd + start-stop-daemon -K -q -p /var/run/netplugd.pid RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd