Skip to content

Commit 4128ef0

Browse files
committed
apt: bypass apt-helper wait-online on multi-NIC systems
apt-daily-upgrade.service uses `apt-helper wait-online` as an ExecStartPre step. On multi-NIC systems with systemd-networkd this helper directly calls systemd-networkd-wait-online in strict mode, waiting for all managed links to become online. On boards with multiple Ethernet ports where some interfaces are commonly unplugged, this results in repeated timeouts and causes apt-daily-upgrade / unattended-upgrades to abort, even when at least one interface is already fully routable. Replace the ExecStartPre step with a direct invocation of systemd-networkd-wait-online using `--any`, allowing the service to proceed as soon as one interface is online. This preserves the intent of waiting for network availability while making the behavior robust on multi-NIC and router-style systems.
1 parent f12ac15 commit 4128ef0

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[Service]
2+
ExecStartPre=
3+
ExecStartPre=/lib/systemd/systemd-networkd-wait-online --any --timeout=60

extensions/network/net-systemd-networkd.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ function pre_install_kernel_debs__configure_systemd_networkd() {
4444
mkdir -p "${networkd_wait_online_override_dst_folder}" # This doesn't exist by default, create it
4545
run_host_command_logged cp -v "${networkd_wait_online_override_src_folder}"* "${networkd_wait_online_override_dst_folder}"
4646

47+
# since daily upgrade is not calling systemd-networkd-wait-online.service (but it should) we need to patch that service too
48+
local apt_daily_upgrade_service_override_src_folder="${EXTENSION_DIR}/config-networkd/systemd/system/apt-daily-upgrade.service.d/"
49+
local apt_daily_upgrade_service_override_dst_folder="${SDCARD}/etc/systemd/system/apt-daily-upgrade.service.d/"
50+
51+
mkdir -p "${apt_daily_upgrade_service_override_dst_folder}" # This doesn't exist by default, create it
52+
run_host_command_logged cp -v "${apt_daily_upgrade_service_override_src_folder}"* "${apt_daily_upgrade_service_override_dst_folder}"
53+
4754
# Change the file permissions according to https://netplan.readthedocs.io/en/stable/security/
4855
chmod -v 600 "${SDCARD}"/etc/netplan/*
4956
}

0 commit comments

Comments
 (0)