0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/switch-to-configuration: don't try restart deleted sockets

This commit is contained in:
Jean-Baptiste Giraudeau 2021-03-11 11:09:50 +01:00
parent 3175628b30
commit 77b7d29bf8
No known key found for this signature in database
GPG key ID: 7CEF8C9CC2D9933B

View file

@ -243,12 +243,16 @@ while (my ($unit, $state) = each %{$activePrev}) {
foreach my $socket (@sockets) {
if (defined $activePrev->{$socket}) {
$unitsToStop{$socket} = 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;
}
}
}
}
# If the unit is not socket-activated, record
# that this unit needs to be started below.