nixos/activation: fix systemd-user daemon-reload in auto-upgrade service (#47695)
The autoupgrade service defined in `system.autoUpgrade` (`nixos/modules/installer/tools/auto-upgrade.nix`) doesn't have `su` in its path and thus yields a warning during the `daemon-reload`. Specifying the absolute path fixes the issue. Fixes #47648
This commit is contained in:
parent
a18b4a58d1
commit
7297cc5501
@ -419,7 +419,7 @@ while (my $f = <$listActiveUsers>) {
|
||||
my ($uid, $name) = ($+{uid}, $+{user});
|
||||
print STDERR "reloading user units for $name...\n";
|
||||
|
||||
system("su", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user daemon-reload");
|
||||
system("@su@", "-s", "@shell@", "-l", $name, "-c", "XDG_RUNTIME_DIR=/run/user/$uid @systemd@/bin/systemctl --user daemon-reload");
|
||||
}
|
||||
|
||||
close $listActiveUsers;
|
||||
|
@ -109,6 +109,7 @@ let
|
||||
inherit (pkgs) utillinux coreutils;
|
||||
systemd = config.systemd.package;
|
||||
shell = "${pkgs.bash}/bin/sh";
|
||||
su = "${pkgs.shadow.su}/bin/su";
|
||||
|
||||
inherit children;
|
||||
kernelParams = config.boot.kernelParams;
|
||||
|
Loading…
Reference in New Issue
Block a user