From 537ed0d545baaa0e4721aab1469cc72562a6ab71 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 13:09:17 +0000 Subject: don't let setuid wrappers hold up sysinit.target Creating the ten setuid wrappers takes ~130ms and is the last thing sysinit.target waits for: [1.896068] Starting Create SUID/SGID Wrappers... [2.025499] Finished Create SUID/SGID Wrappers. [2.027817] Reached target System Initialization. The only wrapper needed during boot is unix_chkpwd, for the autologin, so order the wrappers before systemd-user-sessions.service instead. --- default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index d562380..8b03123 100644 --- a/default.nix +++ b/default.nix @@ -88,6 +88,13 @@ let ]; services.journald.storage = "volatile"; # don't flush to /var/log security.pam.services.login.lastlog.enable = lib.mkForce false; + + # Only login needs a wrapper (unix_chkpwd), so create them in parallel + # to the rest of the boot instead of holding up sysinit.target. + systemd.services.suid-sgid-wrappers = { + wantedBy = lib.mkForce [ "systemd-user-sessions.service" ]; + before = lib.mkForce [ "systemd-user-sessions.service" "shutdown.target" ]; + }; }; }; @@ -121,7 +128,7 @@ let }; }); in -pkgs.writeShellScriptBin "run-firecracker-vm" '' +pkgs.writeShellScriptBin "run-firecracker-vm" /* sh */ '' # usage: run-firecracker-vm [STORE-PATH...] # Packs the closure of the guest system (plus any given store paths) into # an erofs image, which the guest mounts read-only at /nix/store. -- cgit v1.3.1