Merge pull request #115927 from input-output-hk/fix-deleted-sockets-restart

nixos/switch-to-configuration: don't try restart deleted sockets
This commit is contained in:
Timothy DeHerrera 2021-08-20 08:33:42 -06:00 committed by GitHub
commit 3cc7e2f037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}
}