-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
networking: relax networkd-wait-online to avoid multi-NIC timeouts #9311
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a systemd drop-in to override systemd-networkd-wait-online to use --any with a 20s timeout, and updates the packaging script to copy such override files into the guest filesystem during pre-install configuration. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9b17cd9 to
311713d
Compare
Multi-port boards (e.g. NanoPi R6S) frequently have unused interfaces with no-carrier. With the default systemd-networkd-wait-online behavior this can result in "Online state: partial" and a timeout while waiting for all managed links to become online. That failure breaks units that depend on network-online.target such as apt-daily-upgrade / unattended-upgrades. Install a systemd drop-in overriding ExecStart to use: systemd-networkd-wait-online --any --timeout=20 This keeps the intended "wait for networking" semantics while preventing unplugged/unused ports from blocking boot and timers.
311713d to
5df903e
Compare
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@extensions/network/net-systemd-networkd.sh`:
- Around line 40-45: The two local variable names use hyphens which are invalid
in Bash; change both declarations to use underscores (e.g., rename
networkd-wait-online-override_src_folder →
networkd_wait_online_override_src_folder and
networkd-wait-online-override_dst_folder →
networkd_wait_online_override_dst_folder), and update every subsequent reference
(mkdir -p and the run_host_command_logged cp invocation) to use the new
underscore variable names so the script no longer fails under set -e.
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@extensions/network/net-systemd-networkd.sh`:
- Around line 41-45: The source-folder variable
networkd_wait_online_override_src_folder is missing a trailing slash so the cp
glob in run_host_command_logged cp -v
"${networkd_wait_online_override_src_folder}"*
"${networkd_wait_online_override_dst_folder}" will match the directory name
prefix instead of its contents; fix by appending a trailing slash to
networkd_wait_online_override_src_folder (make it consistent with other src
folder vars) so the glob expands to files inside the directory, and verify the
cp invocation still uses the updated variable exactly as named to avoid a
non-zero exit abort under set -e.
13b49f7 to
3514bad
Compare
Relax systemd-networkd-wait-online to prevent timeouts on multi-NIC boards
What / Why
On multi-NIC SBCs and appliances it is common that one or more ports are unplugged (
no-carrier). With the default behavior,systemd-networkd-wait-onlinewaits for all managed interfaces to become online. This often leaves the system in:and causes a timeout.
Services and timers that depend on
network-online.target(notablyapt-daily-upgradeand unattended-upgrades) then fail and skip execution, even though at least one interface is already fully routable.This is a common situation on boards like NanoPi R6S and other router-style devices with multiple Ethernet ports.
Change
Ship a systemd drop-in override for
systemd-networkd-wait-online.servicethat relaxes the “online” criteria:--anyso one routable interface is sufficient--timeout=20Installed file:
Content:
Result
network-online.targetsystemd-networkd-wait-onlinesucceeds as soon as one interface is routableapt-daily-upgradeand unattended upgrades no longer fail due to timeoutsReproducer (before)
networkctl statusshows:systemd-networkd-wait-onlinefails with a timeoutapt-daily-upgrade.servicelogs:Validation (after)
Should succeed quickly.
Should no longer fail because of wait-online.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.