forked from mirrors/nixpkgs
nixos/switch-to-configuration: Handle stopped sockets
The previous logic failed to detect that units were socket-activated when the socket was stopped before switch-to-configuration was run. This commit fixes that and also starts the socket in question.
This commit is contained in:
parent
558158b4f5
commit
ad09f7be14
|
@ -180,12 +180,13 @@ sub handleModifiedUnit {
|
|||
@sockets = ("$baseName.socket");
|
||||
}
|
||||
foreach my $socket (@sockets) {
|
||||
if (defined $activePrev->{$socket}) {
|
||||
# Only restart sockets that actually
|
||||
# exist in new configuration
|
||||
if (-e "$out/etc/systemd/system/$socket") {
|
||||
$socketActivated = 1;
|
||||
$unitsToStop->{$unit} = 1;
|
||||
if (-e "$out/etc/systemd/system/$socket") {
|
||||
$socketActivated = 1;
|
||||
$unitsToStop->{$unit} = 1;
|
||||
# If the socket was not running previously,
|
||||
# start it now.
|
||||
if (not defined $activePrev->{$socket}) {
|
||||
$unitsToStart->{$socket} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue