From af550048e83c4b3b24e400c53fca06613f393880 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Aug 2012 11:09:44 -0400 Subject: [PATCH] switch-to-configuration: Don't restart the suspend/hibernate targets Restarting them has the side effect of suspending/hibernating the system again. --- modules/system/activation/switch-to-configuration.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/system/activation/switch-to-configuration.pl b/modules/system/activation/switch-to-configuration.pl index c70a6159fe3..1d2da3cbf8e 100644 --- a/modules/system/activation/switch-to-configuration.pl +++ b/modules/system/activation/switch-to-configuration.pl @@ -111,10 +111,14 @@ while (my ($unit, $state) = each %{$activePrev}) { # Cause all active target units to be restarted below. # This should start most changed units we stop here as # well as any new dependencies (including new mounts and - # swap devices). - my $unitInfo = parseUnit($newUnitFile); - unless (boolIsTrue($unitInfo->{'RefuseManualStart'} // "false")) { - write_file($restartListFile, { append => 1 }, "$unit\n"); + # swap devices). FIXME: the suspend target is sometimes + # active after the system has resumed, which probably + # should not be the case. Just ignore it. + 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)) { if ($unit eq "sysinit.target" || $unit eq "basic.target" || $unit eq "multi-user.target" || $unit eq "graphical.target") {