switch-to-configuration: Don't restart the suspend/hibernate targets
Restarting them has the side effect of suspending/hibernating the system again.
This commit is contained in:
parent
9e5bbee2b1
commit
af550048e8
@ -111,10 +111,14 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
|||||||
# Cause all active target units to be restarted below.
|
# Cause all active target units to be restarted below.
|
||||||
# This should start most changed units we stop here as
|
# This should start most changed units we stop here as
|
||||||
# well as any new dependencies (including new mounts and
|
# well as any new dependencies (including new mounts and
|
||||||
# swap devices).
|
# swap devices). FIXME: the suspend target is sometimes
|
||||||
my $unitInfo = parseUnit($newUnitFile);
|
# active after the system has resumed, which probably
|
||||||
unless (boolIsTrue($unitInfo->{'RefuseManualStart'} // "false")) {
|
# should not be the case. Just ignore it.
|
||||||
write_file($restartListFile, { append => 1 }, "$unit\n");
|
if ($unit ne "suspend.target" && $unit ne "hibernate.target") {
|
||||||
|
my $unitInfo = parseUnit($newUnitFile);
|
||||||
|
unless (boolIsTrue($unitInfo->{'RefuseManualStart'} // "false")) {
|
||||||
|
write_file($restartListFile, { append => 1 }, "$unit\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} elsif (abs_path($prevUnitFile) ne abs_path($newUnitFile)) {
|
} elsif (abs_path($prevUnitFile) ne abs_path($newUnitFile)) {
|
||||||
if ($unit eq "sysinit.target" || $unit eq "basic.target" || $unit eq "multi-user.target" || $unit eq "graphical.target") {
|
if ($unit eq "sysinit.target" || $unit eq "basic.target" || $unit eq "multi-user.target" || $unit eq "graphical.target") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user