From 15d761a525a025de0680b62e8ab79a9d183f313d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 1 May 2020 17:12:05 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"nixos/systemd.nix:=20don=E2=80=99t=20?= =?UTF-8?q?require=20online=20for=20multi-user.target"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 764c8203b833176d546395a5c1adf193a9ca73f8. While this is desireable in principle, some of our modules and services fail during service startup if no network is available don't currently properly set Wants=network-online.target. If nothing pulls in this target anymore, systemd won't try to reach it. We have many VM tests waiting for `network-online.target`, and after 764c8203b833176d546395a5c1adf193a9ca73f8 fail with the following error message: ``` error: unit "network-online.target" is inactive and there are no pending jobs ``` Most likely, test scripts shouldn't wait for `network-online.target` in first place (as `network-online.target` says nothing about whether a service has been started), but instead, the script should wait for the network ports of the corresponding service to be open. Let's revert this for now, and re-apply in a draft PR, fixing the tests before merging it back in. --- nixos/modules/system/boot/systemd.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 58e2f9d3bfce..2167df60bc9a 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -1033,6 +1033,7 @@ in systemd.services.systemd-journald.stopIfChanged = false; systemd.targets.local-fs.unitConfig.X-StopOnReconfiguration = true; systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true; + systemd.targets.network-online.wantedBy = [ "multi-user.target" ]; systemd.services.systemd-binfmt.wants = [ "proc-sys-fs-binfmt_misc.mount" ]; # Don't bother with certain units in containers.