diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index e275006cf843..a4b1a4e208fa 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -2844,16 +2844,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}" + ]; }; }) @@ -2873,6 +2868,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") # ================================