From 7297cc550165a7cd10f6a9946c70c3a7198fcc78 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 3 Oct 2018 12:31:08 +0200 Subject: 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 --- nixos/modules/system/activation/switch-to-configuration.pl | 2 +- nixos/modules/system/activation/top-level.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'nixos/modules/system') 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; -- cgit 1.4.1