-
Notifications
You must be signed in to change notification settings - Fork 225
Create custom systemd-networkd-wait-online.service override to wait on individual interfaces. (LP: #2060311) #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
PPA for testing can be found in: https://launchpad.net/~slyon/+archive/ubuntu/lp2060311/+packages |
6482ac5 to
6e37de0
Compare
|
This seem to work well. The new I did find a case though where the behavior changes: when you have the loopback interface in your yaml. Apparently |
Yeah either ignore it or would have to set a different operational state range, e.g. |
enr0n
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new behavior matches what we have discussed. I did some testing with various combinations of optional: for eth0 and wlan0 and things work as expected in all cases.
|
While I'm not seeing issues specifically related to cloud-init, this doesn't seem to be working correctly, or I'm not understanding how it is supposed to work. After install the PPA, if I reboot, regardless what I have under and nothing else. |
@TheRealFalcon As long as you have any network definition in /etc/netplan/ that uses networkd as a renderer and does NOT use "optional: true" you should see the corresponding interface listed in that file after calling "netplan apply" (or reboot). |
|
Does it matter that I'm in an LXD container? |
It worked in an LXD container for me earlier today. But it could have some impact on the macaddress matching.. can you try with a different matching condition, like name or driver? Looks like it doesn't find the interface here. I need to double-check that. |
|
@slyon , doh, sorry. This was after I tore down a previous container and forgot to update my network configuration. Once I corrected the MAC address, it worked for me. |
|
Looks like cloud-init is still having issues first boot. During our init-local timeframe, we write out netplan config, then call This can be simulated in a container by running After boot: |
|
Another thing I've found is that |
98d7f8a to
931c634
Compare
|
Added a tiny fix to recognize that we do not configure link-local IPs on bridge/bond members. (and of course, a codestyle typo as a follow-up ;-)) |
…aces only Skip s-n-wait-online if we don't have any non-optional interfaces, using a "ConditionPathIsSymbolicLink=" checking Netplan's s-n-wait-online.service enablement symlink. This is in favor to RequiredForOnline=yes as the behavior of upstream (pure) systemd-networkd-wait-online.service is not mean to be used in this way. If "RequiredForOnline=no" sd-networkd-wait-online will fully ignore the corresponding interface and it will block/delay network-online.target if no interfaces are "RequiredForOnline=yes" at all. FR-7246
…nal state for interfaces without IP configuration
Origin: canonical/netplan@e56a3dc Bug-Ubuntu: https://bugs.launchpad.net/netplan/+bug/2060311 Forwarded: canonical/netplan#456
…aces only Skip s-n-wait-online if we don't have any non-optional interfaces, using a "ConditionPathIsSymbolicLink=" checking Netplan's s-n-wait-online.service enablement symlink. This is in favor to RequiredForOnline=yes as the behavior of upstream (pure) systemd-networkd-wait-online.service is not mean to be used in this way. If "RequiredForOnline=no" sd-networkd-wait-online will fully ignore the corresponding interface and it will block/delay network-online.target if no interfaces are "RequiredForOnline=yes" at all. FR-7246 Origin: canonical/netplan@494b2e4 Bug-Ubuntu: https://bugs.launchpad.net/netplan/+bug/2060311 Forwarded: canonical/netplan#456
…nal state for interfaces without IP configuration Origin: canonical/netplan@98d7f8a Bug-Ubuntu: https://bugs.launchpad.net/netplan/+bug/2060311 Forwarded: canonical/netplan#456
…local addresses Origin: canonical/netplan@347d3fd Bug-Ubuntu: https://bugs.launchpad.net/netplan/+bug/2060311 Forwarded: canonical/netplan#456
Description
Skip s-n-wait-online if we don't have any non-optional interfaces, using a "ConditionPathIsSymbolicLink=" checking Netplan's s-n-wait-online.service enablement symlink.
This is in favor to RequiredForOnline=yes as the behavior of upstream (pure)
systemd-networkd-wait-online.service is not mean to be used in this way.
If "RequiredForOnline=no" sd-networkd-wait-online will fully ignore the
corresponding interface and it will block/delay network-online.target if
no interfaces are "RequiredForOnline=yes" at all.
FR-7246
Note: This is a replacement for #455 that keeps compatibility with cloud-init, so it can still sort
After=systemd-networkd-wait-online.serviceANDBefore=network-online.target.Checklist
make checksuccessfully.make check-coverage).