[Bug 2039083] Re: "optional: true" flag introduces problem it's meant to fix in certain circumstances
Nick Rosbrook
2039083 at bugs.launchpad.net
Thu Nov 30 19:42:23 UTC 2023
Lukas - upstream is actually broken in v253 until v253.6, and the reason
it appears "OK" in v253.5 (which we have in Mantic) is that [1]
introduces a bug upstream that makes systemd-networkd-wait-online behave
similarly to Ubuntu's patched systemd-networkd-wait-online prior to
systemd 249.11-0ubuntu3.10. Since (a) there has been lots of churn in
this area already with SRUs and bug reports, and (b) we really need to
implement our network-online spec to *really* fix this, I decided to
leave it alone for Mantic.
Isaac - what happens if you add the --any flag to systemd-networkd-wait-
online.service (best to do this with an override config), e.g.
# /etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf
[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --any
That should make it so that it does not wait on all the other unmanaged
interfaces. I realize this is a change in behavior in Jammy, but the old
behavior systemd-networkd-wait-online was worse in my opinion. It's
"wrong" to run systemd-networkd-wait-online without arguments on a
system where not everything is managed by systemd-networkd, so I think
the best solution for users in Isaac's situation is to add overrides
that work for their setup.
[1]
https://github.com/systemd/systemd/commit/ab3aed4a0349bbaa26f53340770c1b59b463e05d
** Changed in: systemd (Ubuntu)
Status: Confirmed => Incomplete
** Tags removed: rls-jj-incoming
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2039083
Title:
"optional: true" flag introduces problem it's meant to fix in certain
circumstances
Status in netplan:
Invalid
Status in systemd package in Ubuntu:
Incomplete
Bug description:
Hello!
This bug is in relation to the situation where the "systemd-networkd-
wait-online.service" hangs for several minutes on boot before
eventually failing. I guess I don't know if this flag was introduced
specifically for this situation, but I do know that one of the fixes
for this issue is to add "optional: true" to any non-critical
interfaces (as per the docs[1]). While this may be the case, it just
so happens that adding this flag to an interface when it's the only
configured interface in netplan can actually INTRODUCE the issue as
well. Example:
---
:~# grep -Ev "^#" /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
enp5s0:
dhcp4: true
optional: true
---
The above config will cause the service hang/failure, and the removal
of the flag will resolve the issue. I primarily opened this bug report
with the idea that we might update aforementioned documentation to
include a caveat that you want to avoid adding this flag to the only
configured interface. However, it was also discussed that we might
consider having the netplan config parser complain about such a setup
and consider it invalid, which it kinda is. I believe in a situation
where you may have a server that should have NO network connectivity,
you would simply leave netplan unconfigured and/or stop any relevant
services, rather than try to configure all interfaces as optional.
My original test was on Jammy, though I tested this also on Focal and
Bionic, and neither of those appear to be affected by this - setting
the only interface as optional in either of those does not cause the
"systemd-networkd-wait-online" service to hang and the system boots
normally.
Let me know if you'd like/need any more info from me! Thank you!
[1] https://netplan.io/faq#prevent-waiting-for-interface
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/2039083/+subscriptions
More information about the foundations-bugs
mailing list