On Fri Jan 20, 2023 at 5:26 PM UTC, Jeff King wrote:

> This has the minor downside that on system startup, we'll spend time
> trying to bring up allow-hotplug interfaces, even if they're not
> available. So on my system, for example, with:
>
>   allow-hotplug eth0
>   iface eth0 inet dhcp
>
>   auto wlan0
>   iface wlan0 inet manual
>   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
>
> this introduces a 10-second lag to the boot process as the dhcp client
> broadcasts over eth0, which has no cable plugged in (it's udhcpc in my
> case, but I imagine it would be the same for any client).
>
> It's definitely less bad than the problem you were fixing. But it makes
> me wonder if the solution here is neglecting the reason that these
> interfaces are marked allow-hotplug and not "auto" in the first place.

What you describing is correct behavior.

According to "man 5 interface":

"Interfaces marked "allow-hotplug" are brought up when udev detects them.
This can either be during boot if the interface is already present, or at
a later time, for example when plugging in a USB network card. Please
note that this does not have anything to do with detecting a network
cable being pluggied in."

So unplugged cable doesn't mean that the device is not plugged.

But now we have a boot delay in configurations like Jeff, which is bad.

The reason for this is that dhclient goes background only after trying to
get lease by sending DHCPDISCOVER six times which can take up to one
minute. This leads to a longer networking.service systemd unit start time
and postpone reaching systemd network target which in most cases leads to
a longer boot times (due to systemd unit dependencies).

Currently I don't know how to correctly fix this. Given that the problem
I initially described is very old (probably dates back to systemd
migration) and no-one complained, maybe the right thing to do is to
revert the change.

Thank you.

P.S.: Yes, probably Debian installer should add PCI NICs as auto, not as
allow-hotplug, but in this case after fresh installing Debian and just
adding your wlan0 configuration (not changing eth0 which will be auto)
you'll get the same boot delay even without my change.

>
> -Peff

Reply via email to