wait up to 30 seconds for postgresql to start before trying to create the database

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14052 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2012-10-18 16:23:04 +00:00
parent 3d412df13c
commit 1689390cc3

View File

@ -771,7 +771,7 @@ sub pgstart
# check to see if running before continuing
my $retries =0;
my $pgstarted =0;
while ($retries < 3) {
while ($retries < 30) {
$retries++;
if (defined($::postgres9)) { # set to the PTF level of postgresql 9.X
$cmd = "service postgresql-9.$::postgres9 status";
@ -783,7 +783,7 @@ sub pgstart
$pgstarted=1;
last;
}
sleep 10;
sleep 1;
}
if ($pgstarted ==0) { # failed to started
xCAT::MsgUtils->message("E", " service postgresql start failed.");