defect 3525895: check the status of xcatd before continuing in the xcatconfig

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12661 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2012-05-14 08:57:20 +00:00
parent 9fc48a2a59
commit 8b90088bf9

View File

@ -368,6 +368,9 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL || $::genCredentials)
system($xcmd);
}
# wait for the starting of xcatd
&waitxcatd;
# more config needed after xcatd start
if ($::INITIALINSTALL || $::FORCE)
{
@ -1697,6 +1700,31 @@ sub mknb
}
#-----------------------------------------------------------------------------
=head3 waitxcatd
Wait xcatd to function after the restart of xcatd
=cut
#-----------------------------------------------------------------------------
sub waitxcatd {
my $cmd = "$::XCATROOT/bin/nodels -v";
my $n = 0;
while ($n++ < 10) {
sleep 1;
my $output = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC == 0 || $output =~ /Version/) {
last;
} else {
next;
}
}
if ($n >= 10) {
print "Failed to check the status of xcatd\n";
}
}
#-----------------------------------------------------------------------------
=head3 makenetworks