aboutsummaryrefslogtreecommitdiff
path: root/package/netplug
diff options
context:
space:
mode:
authorGravatar Carlos Santos <casantos@datacom.com.br>2018-06-06 22:36:41 -0300
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2018-06-07 16:03:33 +0200
commit3c6a5bdd3ed94f97afe2db9123d7117f85f654ce (patch)
treea0dab46f5e985a389b416588de5fb84d60613330 /package/netplug
parent41a365d40bf8f391a9af2ac9c7a18bfff97f35f9 (diff)
downloadbuildroot-3c6a5bdd3ed94f97afe2db9123d7117f85f654ce.tar.gz
buildroot-3c6a5bdd3ed94f97afe2db9123d7117f85f654ce.tar.bz2
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 <mail2k@web.de> Signed-off-by: Carlos Santos <casantos@datacom.com.br> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'package/netplug')
-rwxr-xr-xpackage/netplug/S29netplug4
1 files changed, 2 insertions, 2 deletions
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