summary refs log tree commit diff
path: root/nixos/modules/system/activation
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2021-12-07 12:44:08 +0100
committerJanne Heß <janne@hess.ooo>2021-12-07 14:32:19 +0100
commit1f41365cdacf9d101e4b2a54b7f74ad637ce3f72 (patch)
tree90be4a1c50f1bf2264478fa451635be598b8893f /nixos/modules/system/activation
parent08586ff5921e9511a5eef8259ac334063d718ce7 (diff)
downloadnixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar.gz
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar.bz2
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar.lz
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar.xz
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.tar.zst
nixpkgs-1f41365cdacf9d101e4b2a54b7f74ad637ce3f72.zip
nixos/switch-to-configuration: Restart systemd when system.conf is changed
Diffstat (limited to 'nixos/modules/system/activation')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl
index 9bf7a5c0d42..d3e9a97c212 100644
--- a/nixos/modules/system/activation/switch-to-configuration.pl
+++ b/nixos/modules/system/activation/switch-to-configuration.pl
@@ -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 {