From bd7ea9be5895e3545fbd35450f5d0db521684396 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Dec 2012 17:42:54 +0100 Subject: [PATCH] sysinit.target: Drop the dependency on local-fs.target and swap.target Having all services with DefaultDependencies=yes depend on local-fs.target is annoying, because some of those services might be necessary to mount local filesystems. For instance, Charon's send-keys feature requires sshd to be running in order to receive LUKS encryption keys, which in turn requires dhcpcd, and so on. So we drop this dependency (and swap.target as well for consistency). If services require a specific mount, they should use RequiresMountsFor in any case. --- modules/system/boot/systemd.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index 720c8efc53fa..eee65a3ffe0f 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -22,7 +22,7 @@ let upstreamUnits = [ # Targets. "basic.target" - "sysinit.target" + #"sysinit.target" "sockets.target" "graphical.target" "multi-user.target" @@ -459,6 +459,17 @@ in { description = "Security Keys"; }; + # This is like the upstream sysinit.target, except that it doesn't + # depend on local-fs.target and swap.target. If services need to + # be started after some filesystem (local or otherwise) has been + # mounted, they should use the RequiresMountsFor option. + boot.systemd.targets.sysinit = + { description = "System Initialization"; + after = [ "emergency.service" "emergency.target" ]; + unitConfig.Conflicts = "emergency.service emergency.target"; + unitConfig.RefuseManualStart = true; + }; + boot.systemd.units = { "rescue.service".text = rescueService; } // mapAttrs' (n: v: nameValuePair "${n}.target" (targetToUnit n v)) cfg.targets