summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorTimothy DeHerrera <tim.deh@pm.me>2021-08-20 08:33:42 -0600
committerGitHub <noreply@github.com>2021-08-20 08:33:42 -0600
commit3cc7e2f037acfa6eb86ed04e5b3c923695597779 (patch)
tree88d5b8ea924077328b5f1ddc7bcf3333504333eb /nixos
parent066bcd954fc2a81c4fe97025b9a86e53d6835432 (diff)
parent77b7d29bf83b40defe90c02e346665dc4a69721f (diff)
Merge pull request #115927 from input-output-hk/fix-deleted-sockets-restart
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 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;
+ }
}
}
}