From 0d48c50f4b01ff434fa58900e62c02a078f62681 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sat, 30 Nov 2024 07:01:29 +0100 Subject: [PATCH] nixos/networkd: use upstream wait-online@ unit Use the upstream unit for systemd-networkd-wait-online@.service and fix the spelling. --- nixos/modules/system/boot/networkd.nix | 16 ++++++---------- nixos/tests/systemd-networkd.nix | 4 ++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 2ff79f1cdc85..2bd24414bbe9 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -2843,16 +2843,11 @@ let ]; }; - systemd.services."systemd-network-wait-online@" = { - description = "Wait for Network Interface %I to be Configured"; - conflicts = [ "shutdown.target" ]; - requisite = [ "systemd-networkd.service" ]; - after = [ "systemd-networkd.service" ]; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - ExecStart = "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %I ${utils.escapeSystemdExecArgs cfg.wait-online.extraArgs}"; - }; + systemd.services."systemd-networkd-wait-online@" = { + serviceConfig.ExecStart = [ + "" + "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online -i %i ${utils.escapeSystemdExecArgs cfg.wait-online.extraArgs}" + ]; }; }) @@ -2872,6 +2867,7 @@ let systemd.additionalUpstreamSystemUnits = [ "systemd-networkd-wait-online.service" + "systemd-networkd-wait-online@.service" "systemd-networkd.service" "systemd-networkd.socket" "systemd-networkd-persistent-storage.service" diff --git a/nixos/tests/systemd-networkd.nix b/nixos/tests/systemd-networkd.nix index 34272f9b0411..2923967cc897 100644 --- a/nixos/tests/systemd-networkd.nix +++ b/nixos/tests/systemd-networkd.nix @@ -96,7 +96,11 @@ in import ./make-test-python.nix ({pkgs, ... }: { }; testScript = '' start_all() + node1.succeed("systemctl start systemd-networkd-wait-online@eth1.service") + node1.wait_for_unit("systemd-networkd-wait-online@eth1.service") node1.wait_for_unit("systemd-networkd-wait-online.service") + node2.succeed("systemctl start systemd-networkd-wait-online@eth1.service") + node2.wait_for_unit("systemd-networkd-wait-online@eth1.service") node2.wait_for_unit("systemd-networkd-wait-online.service") # ================================