summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorJean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>2021-03-11 11:09:50 +0100
committerJean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>2021-03-11 11:34:16 +0100
commit77b7d29bf83b40defe90c02e346665dc4a69721f (patch)
tree07256bd5f2e750bc4d22ccfa25bf74c2f3598474 /nixos
parent3175628b30394709a9a18c1e92a9fa4d74ed2764 (diff)
nixos/switch-to-configuration: don't try restart deleted sockets
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/activation/switch-to-configuration.pl10
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 b82d69b3bb85..0445f39a8279 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;
+ }
}
}
}