diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/activation/switch-to-configuration.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 8bd85465472f..dd391c8b5d78 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -243,9 +243,13 @@ while (my ($unit, $state) = each %{$activePrev}) { foreach my $socket (@sockets) { if (defined $activePrev->{$socket}) { $unitsToStop{$socket} = 1; - $unitsToStart{$socket} = 1; - recordUnit($startListFile, $socket); - $socketActivated = 1; + # Only restart sockets that actually + # exist in new configuration: + if (-e "$out/etc/systemd/system/$socket") { + $unitsToStart{$socket} = 1; + recordUnit($startListFile, $socket); + $socketActivated = 1; + } } } } |