check for could not connect to database postgres error on createdb
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14122 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
bd1a88c706
commit
cfcf1b8cfc
@ -632,9 +632,10 @@ sub runpgcmd_chkoutput
|
||||
$cmd .= "\'";
|
||||
|
||||
my $retries=0;
|
||||
my @output;
|
||||
while ($retries < 6) {
|
||||
$retries++;
|
||||
my @output =`su - postgres -c $cmd`;
|
||||
@output =`su - postgres -c $cmd`;
|
||||
if (grep(/could not connect to database postgres/, @output)) {
|
||||
sleep 5;
|
||||
$rc=1
|
||||
@ -646,6 +647,11 @@ sub runpgcmd_chkoutput
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($rc == 1) { # print out the postgresql connect failure
|
||||
foreach my $line (@output) {
|
||||
print "$line \n";
|
||||
}
|
||||
}
|
||||
return $rc;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user