udhcpc: udhcpc not stopping due to Ethernet power down

Bryan Evenson bevenson at melinkcorp.com
Wed Jun 13 15:40:43 UTC 2018


Alex,

> -----Original Message-----
> From: Alexander Dahl [mailto:ada at thorsis.com]
> Sent: Wednesday, June 13, 2018 3:47 AM
> To: busybox at busybox.net
> Cc: Bryan Evenson <bevenson at melinkcorp.com>
> Subject: Re: udhcpc: udhcpc not stopping due to Ethernet power down
> 
> Hei hei,
> 
> Am Dienstag, 12. Juni 2018, 14:07:39 CEST schrieb Bryan Evenson:
> > using udhcpc for its wired Ethernet port.  The startup script is calling
> > udhcpc as follows:
> >
> > 	udhcpc -R -b -p /var/run/udhcpc.eth0.pid -i eth0
> 
> […]
> 
> > I've been having some networking issues with this device, and I found out
> > that the cable modem its connected to is set to power down the Ethernet
> > connection after two minutes with no traffic.  I do have something a task
> > that uses the network every four minutes, but nothing is guaranteed to
> > operate more frequently than that.  When I finally logged onto my device, I
> > found out that there were about 100 instances of udhcpc up and running.  I
> > believe each time the Ethernet port is enabled udhcpc starts back up again,
> > but for some reason the old instance of udhcpc keeps running.
> 
> Is there some other mechanism active besides your startup script, which starts
> udhcpc? Maybe 'ifup' based on the settings in /etc/network/interfaces does
> this? (Depending on how you configured busybox/udhcpc, ifup, etc. when
> compiling.)
> 
> Did you look at the command line of those 100 instances? Are those exactly the
> same as if you start udhcpc with the startup script? If not, probably those
> are not started with your startup script. If yes, maybe some other
> mechanism starts your startup script again?
> 
> Do you have something running which reacts on cable plugging/unplugging
> like ifplugd? Maybe you find hints on what's going on in the configuration of
> that?

I have ifplugd setup, and it calls ifup when the cable is plugged in and it calls ifdown when the cable is unplugged.  The startup command for ifplugd is:
	ifplugd -i eth0 -fwI -u0 -d10
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.

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.

Thanks,
Bryan

> 
> Greets
> Alex



More information about the busybox mailing list