Removing -n option from udhcpc

Natanael Copa ncopa at alpinelinux.org
Tue Feb 6 19:57:49 UTC 2018


On Tue, 6 Feb 2018 20:04:20 +0100
Denys Vlasenko <vda.linux at googlemail.com> wrote:

> On Mon, Feb 5, 2018 at 8:10 PM, Daykin, Evan <daykin at frib.msu.edu> wrote:
> > Good Afternoon,
> >
> >
> >
> > We have a lot of devices which were shipped running Busybox 1.20.2. We ran a
> > test to see what would happen in the event of a power failure. When power
> > was restored, the devices all booted much faster than the switches they were
> > connected to, so udhcpc gave up and exited,  
> 
> Please be more specific. They exited how? what are the messages from them?
> 
> > leaving the devices unable to
> > obtain a DHCP lease.  We tried setting “udhcpc_opts” to –background in the
> > interfaces file, to no avail. As we understand it, -n and –b are not
> > mutually exclusive, thus the client will still give up and exit after a few
> > attempts.  
> 
> Of course. If you gave -n to udhcpc, it will exit if lease is not obtained.
> If you don't want this, don't give it the -n option.

FWIW, we use this config in Alpine Linux:

CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-b"

which make ifup add -b to the udhcpc call so it goes to background til
network comes up. If a user don't want this behavior he can disable it
with `udhcp_opts -n` in /etc/network/interfaces. For that this patch
is needed:
https://git.alpinelinux.org/cgit/aports/tree/main/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch

With that patch no rebuild of busybox is needed to reconfig the
behavior.

-nc


More information about the busybox mailing list