fix(ubuntu/network): wait for any interface, not all

The generic ethernet rule makes an unplugged enp44s0 managed, so
networkd-wait-online blocked on it for the full 120s timeout and delayed
wg-quick@wg0. NixOS pairs its generic DHCP networks with --any for the same
reason.

Assisted-by: pi (claude-opus-5)
This commit is contained in:
Gabriel Fontes
2026-08-13 17:16:15 -03:00
parent c19ed9a3a7
commit baef0c6c8a
+11
View File
@@ -34,6 +34,17 @@
RouteMetric=1025
'';
# Consider the network up as soon as *any* link is, rather than waiting for
# every managed one. Without this the ethernet rule above makes an unplugged
# enp44s0 hold network-online.target for the full 120s timeout, delaying
# everything ordered after it (wg-quick@wg0). This mirrors NixOS, where
# systemd.network.wait-online.anyInterface defaults on with useDHCP.
"systemd/system/systemd-networkd-wait-online.service.d/any-interface.conf".text = ''
[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any
'';
# Neuter netplan without uninstalling it: purging netplan.io would take
# cloud-init, ubuntu-minimal and ubuntu-server-minimal with it. Masking the
# generator is reverted by `system-manager deactivate`, unlike apt state.