udhcpc: udhcpc not stopping due to Ethernet power down

Alexander Dahl ada at thorsis.com
Thu Jun 14 07:15:29 UTC 2018


Hei hei,

Am Mittwoch, 13. Juni 2018, 15:40:43 CEST schrieb Bryan Evenson:
> Link detection errors are treated as link down/link up, so when the router's
> Ethernet port powers down then ifdown is called.  Unfortunately I don't
> have strace installed on this system to test, but from reading the source
> code for ifdown I believe it should be sending a SIGTERM to udhcpc.

It should, if you have a serial console you could check by calling ifdown 
manually (maybe disable ifplugd first), this is what I get:

	$ ifdown -v eth0
	run-parts /etc/network/if-down.d
	kill `cat /var/run/udhcpc.eth0.pid` 2>/dev/null
	ip addr flush dev eth0
	ip link set eth0 down
	run-parts /etc/network/if-post-down.d

You can see the SIGTERM sent by kill to the PID in the pid file created on 
start of the udhcpc. I can confirm udhcpc is not running anymore after that.
 
> I do have another system that is easier for me to test with that is also
> running Busybox version 1.24.1.  I'll try to run some tests later today to
> confirm that udhcpc is getting a SIGTERM signal.  If this is the case, then
> I assume the answer is to upgrade to at least 1.28.2 to grab the fix.

Maybe there's something wrong with getting the right PID? If you have multiple 
instances of udhcpc running, but only one pid file, that could cause trouble? 

Side note: I use ifplugd with the -l option, but don't start udhcpc explicitly 
on startup. ifup sorts that out based on the current network settings.

HTH & Greets
Alex



More information about the busybox mailing list