cluster/fence/agents/bullpap fence_bullpap.pl
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-09-28 22:38:17
Modified files:
fence/agents/bullpap: fence_bullpap.pl
Log message:
Backport the fence_bullpap agent from the RHEL51 branch. This version fixes a timeout bug. Fixes bz309261
fence/agents/bullpap/fence_bullpap.pl +13 -16
@@ -323,27 +323,24 @@ my $timeout = 60; # 60 seconds for "off" for 32-way bull machines set_power_state $host,$domain,"off",$login,$passwd; - if ( $? == 0 ) - { + do { + sleep 5; + $state=get_power_state $host,$domain,$login,$passwd; + $timeout -= 5; + } while ($timeout > 0 && $state != 0); + + if ($timeout <= 0) { + $success = 0; + } else { + $timeout = 120; # 120 seconds for on, for 32-way bull machines + set_power_state $host,$domain,"on",$login,$passwd; do { sleep 5; $state=get_power_state $host,$domain,$login,$passwd; $timeout -= 5; - } while ($timeout > 0 && !($state =~ /^off$/i)); + } while ($timeout > 0 && $state != 0); - if ($timeout > 0) { - $timeout = 120; # 120 seconds for on, for 32-way bull machines - set_power_state $host,$domain,"on",$login,$passwd; - if ( $? == 0 ) - { - do { - sleep 5; - $state=get_power_state $host,$domain,$login,$passwd; - $timeout -= 5; - } while ($timeout > 0 && !($state =~ /^on$/i)); - $success = 1 if ($state =~ /^on$/i); - } - } + $success = 1 if ($state == 0); } } elsif (/status/)