diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2018-10-03 12:31:08 +0200 |
---|---|---|
committer | Uli Baum <xeji@cat3.de> | 2018-10-03 12:43:20 +0200 |
commit | 6e93cdfe3505f64e591393d115f918b9804348f5 (patch) | |
tree | e6657bb095d322946f4db70358caeb9ac87a7788 | |
parent | b7bfb4180e558f9fadd9af945852e3501a169474 (diff) |
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 (cherry picked from commit 7297cc550165a7cd10f6a9946c70c3a7198fcc78 and resolved conflict)
-rw-r--r-- | nixos/modules/system/activation/switch-to-configuration.pl | 2 | ||||
-rw-r--r-- | nixos/modules/system/activation/top-level.nix | 1 |
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 c3e469e4b8a12..daaf8e5421479 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 254e9266e89e6..4885499030e80 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -116,6 +116,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; |