nixos/switch-to-configuration: restart changed socket units
Previously, socket units wouldn't be restarted if they were changed. To restart the socket, the service the socket is attached to needs to be stopped first before the socket can be restarted.
This commit is contained in:
parent
e3e3bd61f8
commit
89806e9536
@ -214,7 +214,17 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
|||||||
# Reload the changed mount unit to force a remount.
|
# Reload the changed mount unit to force a remount.
|
||||||
$unitsToReload{$unit} = 1;
|
$unitsToReload{$unit} = 1;
|
||||||
recordUnit($reloadListFile, $unit);
|
recordUnit($reloadListFile, $unit);
|
||||||
} elsif ($unit =~ /\.socket$/ || $unit =~ /\.path$/ || $unit =~ /\.slice$/) {
|
} elsif ($unit =~ /\.socket$/) {
|
||||||
|
my $unitInfo = parseUnit($newUnitFile);
|
||||||
|
# If a socket unit has been changed, the corresponding
|
||||||
|
# service unit has to be stopped before the socket can
|
||||||
|
# be restarted. The service will be started again on demand.
|
||||||
|
my $serviceUnit = $unitInfo->{'Unit'} // "$baseName.service";
|
||||||
|
$unitsToStop{$serviceUnit} = 1;
|
||||||
|
$unitsToStop{$unit} = 1;
|
||||||
|
$unitsToStart{$unit} = 1;
|
||||||
|
recordUnit($startListFile, $unit);
|
||||||
|
} elsif ($unit =~ /\.path$/ || $unit =~ /\.slice$/) {
|
||||||
# FIXME: do something?
|
# FIXME: do something?
|
||||||
} else {
|
} else {
|
||||||
my $unitInfo = parseUnit($newUnitFile);
|
my $unitInfo = parseUnit($newUnitFile);
|
||||||
|
Loading…
Reference in New Issue
Block a user