On Sat, Oct 29, 2022 at 10:33:26AM +0000, Oleg A. Arkhangelsky wrote: > Since the unit type is oneshot, we can have multiple ExecStart statements. > > Note that we have to use '--ignore-errors'. Otherwise if we have real > hotplug interface that is not present at the moment of restart, `ifup` > returns non-zero and systemd unit fail. > > > diff --git a/debian/networking.service b/debian/networking.service > index 593172b..7ad246b 100644 > --- a/debian/networking.service > +++ b/debian/networking.service > @@ -16,6 +16,7 @@ WantedBy=network-online.target > Type=oneshot > EnvironmentFile=-/etc/default/networking > ExecStart=/sbin/ifup -a --read-environment > +ExecStart=/sbin/ifup -a --allow=hotplug --ignore-errors --read-environment
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. -Peff