about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2021-12-08 23:23:04 +0100
committerGitHub <noreply@github.com>2021-12-08 23:23:04 +0100
commitfec4daf38d0e7cfdefc194c53d568dc75d0e2faa (patch)
tree452c3cbaca460f4cd74b48e5ad087e6c84c715b9 /nixos
parent7370b263d797848f9aa391fc94999eece396f35d (diff)
parent1f41365cdacf9d101e4b2a54b7f74ad637ce3f72 (diff)
Merge pull request #149342 from helsinki-systems/feat/restart-systemd-on-systemconf-change
nixos/switch-to-configuration: Restart systemd when system.conf is changed
Diffstat (limited to 'nixos')
-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 9bf7a5c0d4270..d3e9a97c21204 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 {