diff --git a/xCAT-server/sbin/restartxcatd b/xCAT-server/sbin/restartxcatd index ea4d20756..defc4b212 100755 --- a/xCAT-server/sbin/restartxcatd +++ b/xCAT-server/sbin/restartxcatd @@ -32,10 +32,13 @@ use xCAT::Utils; #----------------------------------------------------------------------------- # Main +$::RE_CHECK_NUM = 10; # the times to check the result of command, the checking interval is 1 second + my $rc; my @output; my $inoperative = 0; my $check_num; + my $cmd = basename($0); # for auditing my $current_userid = getpwuid($>); @@ -82,7 +85,7 @@ if (! $inoperative) { # active } # Wait for end of the xcatd subsystem - $check_num = 5; + $check_num = $::RE_CHECK_NUM; while ($check_num > 0) { $cmd = "lssrc -s xcatd | grep 'xcatd' | grep 'inoperative'"; @output = `$cmd`; @@ -125,7 +128,7 @@ if (scalar(@output)) { my $cmd = "/usr/bin/kill -9 $pid >/dev/null 2>&1"; `$cmd`; } - $check_num = 5; + $check_num = $::RE_CHECK_NUM; while ($check_num > 0) { $cmd = "ps -ef | grep xcatd: | grep -v grep"; @output = `$cmd`; @@ -167,7 +170,7 @@ if ($rc >> 8) { sleep 3; # Check the status of xcatd subsystem -$check_num = 5; +$check_num = $::RE_CHECK_NUM; while ($check_num > 0) { $cmd = "lssrc -s xcatd | grep 'xcatd' | grep 'active'"; my @output = `$cmd`;