Skip to contentSkip to conversation

netplug: prevent starting multiple instances of netplugd

PATCH New Carlos Santos 3 participants 3 messages Jun 7, 2018 – Jun 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 package/netplug/S29netplug | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/netplug/S29netplug +2 -2
index 04cac9f07c..66459061b3 100755
@@ -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
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 netplug: prevent starting multiple instances of netplugd

Hello,

Quoted 7 lines · Carlos Santos

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.

Quoted 7 lines

Fixes https://bugs.busybox.net/show_bug.cgi?id=10661

---
 package/netplug/S29netplug | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 netplug: prevent starting multiple instances of netplugd

In reply to Carlos Santos
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carlos" == Carlos Santos <[email protected]> writes:

Executing "/etc/init.d/S29netplug start" multiple times resulted in multiple instances of netplugd.

Quoted 8 lines

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

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard