Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
nixos/activation: fix systemd-user daemon-reload in auto-upgrade serv…
Browse files Browse the repository at this point in the history
…ice (#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
  • Loading branch information
Ma27 authored and xeji committed Oct 3, 2018
1 parent a18b4a5 commit 7297cc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/system/activation/switch-to-configuration.pl
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ sub filterUnits {
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;
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/system/activation/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7297cc5

Please sign in to comment.