nixos/switch-to-configuration: Restart non-services

This commit is contained in:
Janne Heß 2021-12-09 12:31:05 +01:00
parent efcdc01d62
commit 2024306048
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -170,7 +170,9 @@ sub handleModifiedUnit {
elsif (!boolIsTrue($unitInfo->{'X-RestartIfChanged'} // "yes") || boolIsTrue($unitInfo->{'RefuseManualStop'} // "no") || boolIsTrue($unitInfo->{'X-OnlyManualStart'} // "no")) {
$unitsToSkip->{$unit} = 1;
} else {
if (!boolIsTrue($unitInfo->{'X-StopIfChanged'} // "yes")) {
# It doesn't make sense to stop and start non-services because
# they can't have ExecStop=
if (!boolIsTrue($unitInfo->{'X-StopIfChanged'} // "yes") || $unit !~ /\.service$/) {
# This unit should be restarted instead of
# stopped and started.
$unitsToRestart->{$unit} = 1;