From b41ca289af833535dea0c58d09507bbe6850e293 Mon Sep 17 00:00:00 2001 From: ligc Date: Sun, 27 Sep 2009 03:03:17 +0000 Subject: [PATCH] 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 --- xCAT-server/sbin/xcatd | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index d1e4ec59f..df94d2af7 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -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');