0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/switch-to-configuration: Restart systemd when system.conf is changed

This commit is contained in:
Janne Heß 2021-12-07 12:44:08 +01:00
parent 08586ff592
commit 1f41365cda
No known key found for this signature in database
GPG key ID: 69165158F05265DF

View file

@ -351,8 +351,14 @@ foreach my $device (keys %$prevSwaps) {
# Should we have systemd re-exec itself?
my $prevSystemd = abs_path("/proc/1/exe") // "/unknown";
my $prevSystemdSystemConfig = abs_path("/etc/systemd/system.conf") // "/unknown";
my $newSystemd = abs_path("@systemd@/lib/systemd/systemd") or die;
my $newSystemdSystemConfig = abs_path("$out/etc/systemd/system.conf") // "/unknown";
my $restartSystemd = $prevSystemd ne $newSystemd;
if ($prevSystemdSystemConfig ne $newSystemdSystemConfig) {
$restartSystemd = 1;
}
sub filterUnits {