[pve-devel] [RFC v3 pve-ha-manager 5/8] lrm: only freeze services if lrm is in 'restart' mode

Dietmar Maurer dietmar at proxmox.com
Wed Dec 16 09:04:47 CET 2015


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/PVE/HA/Manager.pm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm
index 6a98cd3..9ee5fba 100644
--- a/src/PVE/HA/Manager.pm
+++ b/src/PVE/HA/Manager.pm
@@ -357,14 +357,14 @@ sub manage {
 		die "unknown service state '$last_state'";
 	    }
 
-
 	    my $lrm_mode = $sd->{node} ? $lrm_modes->{$sd->{node}} : undef;
-	    $lrm_mode = 'unknown'if !$lrm_mode;
-	    if (($sd->{state} eq 'started' || $sd->{state} eq 'stopped' ||
-		 $sd->{state} eq 'request_stop') && ($lrm_mode ne 'active')) {
-		&$change_service_state($self, $sid, 'freeze');
+	    if ($lrm_mode && $lrm_mode eq 'restart') {
+		if (($sd->{state} eq 'started' || $sd->{state} eq 'stopped' ||
+		     $sd->{state} eq 'request_stop')) {
+		    &$change_service_state($self, $sid, 'freeze');
+		}
 	    }
-		    
+
 	    $repeat = 1 if $sd->{state} ne $last_state;
 	}
 
-- 
2.1.4




More information about the pve-devel mailing list