about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-10-03 12:31:08 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-10-03 12:31:08 +0200
commit7297cc550165a7cd10f6a9946c70c3a7198fcc78 (patch)
tree4608d4a398cc228ef63cd304b9422352da7672f9
parenta18b4a58d161272bb4bfb65a589554d1a048c1cf (diff)
downloadnixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar.gz
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar.bz2
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar.lz
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar.xz
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.tar.zst
nixlib-7297cc550165a7cd10f6a9946c70c3a7198fcc78.zip
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
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl2
-rw-r--r--nixos/modules/system/activation/top-level.nix1
2 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index c3e469e4b8a1..daaf8e542147 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -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;
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 413543df88c6..a560af5ce96d 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -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;