fix for bug 3560143: setup postgresql during xcat installation

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13567 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2012-08-21 06:17:07 +00:00
parent 032a6d79dc
commit 934084df40

View File

@ -134,6 +134,28 @@ else
}
#
# If the XCATPGPW environment variable is specified,
# call pgsqlsetup command with -N flag to setup PostgreSQL database.
# This is a requirement of PCM, it should be done only in install scenario but not update.
#
if ($::INITIALINSTALL || $::FORCE)
{
if (($::osname eq 'Linux') && $ENV{'XCATPGPW'})
{
my $cmd = "XCATPGPW=$ENV{'XCATPGPW'} $::XCATROOT/bin/pgsqlsetup -i -N";
my $outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message('E', "Could not setup PostgreSQL, falling back to sqlite...");
$cmd = "rm -f /etc/xcat/cfgloc";
$outref = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message('E', "Could not fall back to sqlite, where should we go?");
}
}
}
}
# To support AIX INUCLIENTS, to support the scenario where the user needs to install xCAT rpms
# into the INUCLIENT=1 environment, such as AIX diskless node(installing xCAT in AIX NIM SPOT),
# or alternative disk installation.