wait-online: don't ignore configured interfaces with RequiredForOnline=no#32016
wait-online: don't ignore configured interfaces with RequiredForOnline=no#32016enr0n wants to merge 1 commit intosystemd:mainfrom
Conversation
…e=no The current behavior of systemd-networkd-wait-online with regards to interfaces with RequiredForOnline=no is counter intuitive. For example, suppose a system has only lo, eth0, and wlan0 interfaces, and that each eth0 and wlan0 are configured with RequiredForOnline=no. Then, $ systemd-networkd-wait-online --any will timeout even if either eth0 or wlan0 are configured, because systemd-networkd-wait-online does not even check the state of interfaces with RequiredForOnline=no. Even if an interface is not _required_ for online, it should be able to satisfy online. So, when iterating interfaces by index, do not ignore those that have RequiredForOnline=no.
yuwata
left a comment
There was a problem hiding this comment.
Currently RequiredForOnline= controls if the interface is handled by systemd-networkd-wait-online. So, this breaks existing setup.
E.g. eth0 has RequiredForOnline=no and it is online, and eth1 has RequiredForOnline=yes but it is not online, then without this PR s-n-wait-online --any ignores eth0 and waits for eth1 being online, but with this PR the command immediately exits with success and does not wait for eth1.
I do not think we can change the current behavior without breaking possibly existing setups.
|
As I recently replied to another PR and issue, if all interfaces have |
|
Okay, that's fair enough I think. I still think the behavior of The motivation here is that netplan has an Anyways, I understand we don't want to break existing setups so I will suggest a change in netplan to use the templated units or something. |
The current behavior of systemd-networkd-wait-online with regards to interfaces with RequiredForOnline=no is counter intuitive. For example, suppose a system has only lo, eth0, and wlan0 interfaces, and that each eth0 and wlan0 are configured with RequiredForOnline=no. Then,
$ systemd-networkd-wait-online --any
will timeout even if either eth0 or wlan0 are configured, because systemd-networkd-wait-online does not even check the state of interfaces with RequiredForOnline=no.
Even if an interface is not required for online, it should be able to satisfy online. So, when iterating interfaces by index, do not ignore those that have RequiredForOnline=no.