fix for bug 2867833: wait database initialization in xcatd

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4243 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2009-09-27 03:03:17 +00:00
parent f38e2e552f
commit b41ca289af

View File

@ -112,9 +112,18 @@ my $port;
my $sport;
my $domain;
my $xcatdir;
my $sitetab=xCAT::Table->new('site');
my $sitetab;
my $retries = 0;
# The database initialization may take some time in the system boot scenario
# wait for a while for the database initialization
while (!($sitetab=xCAT::Table->new('site')) && $retries < 20)
{
print ("Can not open basic site table for configuration, waiting the database to be initialized.\n");
sleep 1;
$retries++;
}
unless ($sitetab) {
print ("ERROR: Unable to open basic site table for configuration\n");
die "ERROR: Unable to open basic site table for configuration\n";
}
my ($tmp) = $sitetab->getAttribs({'key'=>'xcatdport'},'value');