From cfcf1b8cfc9a052dfc939d9f4df2bd62580d1a4c Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 25 Oct 2012 14:09:17 +0000 Subject: [PATCH] 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 --- xCAT-client/bin/pgsqlsetup | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/pgsqlsetup b/xCAT-client/bin/pgsqlsetup index 423e0fc95..672185fb4 100755 --- a/xCAT-client/bin/pgsqlsetup +++ b/xCAT-client/bin/pgsqlsetup @@ -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;