From f810d023ddfbf59059cda3dbccc5b0d3a85e92c0 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 25 Mar 2010 10:21:08 +0000 Subject: [PATCH] add the waiting time for startsrc/stopsrc command git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5578 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/restartxcatd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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`;