Skip to content

Conversation

@igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Jan 29, 2026

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-online waits for all managed interfaces to become online. This often leaves the system in:

Online state: partial

and causes a timeout.

Services and timers that depend on network-online.target (notably apt-daily-upgrade and 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.service that relaxes the “online” criteria:

  • Use --any so one routable interface is sufficient
  • Reduce the waiting time with --timeout=20

Installed file:

/etc/systemd/system/systemd-networkd-wait-online.service.d/override.conf

Content:

[Service]
ExecStart=
ExecStart=/lib/systemd/systemd-networkd-wait-online --any --timeout=20

Result

  • Unused or unplugged interfaces no longer block network-online.target
  • systemd-networkd-wait-online succeeds as soon as one interface is routable
  • apt-daily-upgrade and unattended upgrades no longer fail due to timeouts
  • Keeps the intended “wait for network” semantics without being overly strict

Reproducer (before)

  • Multi-NIC board with only one connected interface
  • networkctl status shows:
Online state: partial
  • systemd-networkd-wait-online fails with a timeout
  • apt-daily-upgrade.service logs:
systemd-networkd-wait-online returned error code (1)

Validation (after)

systemctl start systemd-networkd-wait-online.service
systemctl status systemd-networkd-wait-online.service

Should succeed quickly.

systemctl start apt-daily-upgrade.service

Should no longer fail because of wait-online.

Summary by CodeRabbit

  • Chores
    • Updated system network readiness so startup waits for any network interface with a 20‑second timeout.
    • Installer now deploys the network readiness override into the target system so the updated startup behavior is applied automatically.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added 02 Milestone: First quarter release size/small PR with less then 50 lines labels Jan 29, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Systemd Service Configuration
extensions/network/config-networkd/systemd/system/systemd-networkd-wait-online.service.d/armbian-any-interface.conf
New systemd drop-in that clears default ExecStart and sets ExecStart=/lib/systemd/systemd-networkd-wait-online --any --timeout=20.
Packaging / Install Script
extensions/network/net-systemd-networkd.sh
In pre_install_kernel_debs__configure_systemd_networkd, create drop-in destination dir if missing and copy override files from the extension config into the guest filesystem.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped where units wait in line,
I tucked a tiny drop-in fine,
Any interface gets a try,
Twenty seconds — then say hi,
Networks dance, and I nibble a rhyme. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: installing a systemd drop-in override to relax networkd-wait-online from requiring all interfaces online to requiring any single interface, thereby avoiding timeouts on multi-NIC systems.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wait-online

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Needs review Seeking for review Framework Framework components labels Jan 29, 2026
@igorpecovnik igorpecovnik added Work in progress Unfinished / work in progress and removed Needs review Seeking for review labels Jan 29, 2026
@github-actions github-actions bot added the Needs review Seeking for review label Jan 29, 2026
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.
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Framework Framework components Needs review Seeking for review size/small PR with less then 50 lines Work in progress Unfinished / work in progress

Development

Successfully merging this pull request may close these issues.

2 participants