add support for the site.databaseloc attribute to the db2 setup postscripts

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9077 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2011-03-17 16:56:48 +00:00
parent 60c15d4c94
commit aee619921c
2 changed files with 14 additions and 3 deletions

View File

@ -72,6 +72,7 @@ $::hname = `hostname`;
chomp $::hname;
$::MN = $ENV{'MASTER'}; # as known by the node
$::databaseloc = $ENV{'DATABASELOC'}; # directory for db instance
if ($::osname eq 'AIX')
{
$::installdb2dir = "/opt/IBM/db2/V9.7"; # default
@ -520,8 +521,13 @@ sub rundb2sqlsetup
close($cfgl);
chomp $xcatcfg;
my ($database, $instance, $password) = split('\|', $xcatcfg);
$cmd =
if ($::databaseloc) {
$cmd =
"DATABASELOC=$::databaseloc XCATDB2SERVER=$::MN XCATDB2PW=$password $::XCATROOT/bin/db2sqlsetup -i -C";
} else {
$cmd =
"XCATDB2SERVER=$::MN XCATDB2PW=$password $::XCATROOT/bin/db2sqlsetup -i -C";
}
$msg = "db2install:Running Client setup. \"$::XCATROOT/bin/db2sqlsetup -i -C\"\n";
`logger -t xcat $msg`;

View File

@ -48,7 +48,8 @@ chomp $::sdate;
my $msg;
# get location of database
$::databaseloc = $ENV{'DATABASELOC'};
# check the /etc/xcat/cfgloc file to see if MySQL or DB2
# if it is not here, error out
my $dbname = xCAT::Utils->get_DBName;
@ -103,7 +104,11 @@ sub setupdb2odbc
close($cfgl);
chomp $xcatcfg;
my ($database, $instance, $password) = split('\|', $xcatcfg);
$cmd = "$::XCATROOT/bin/db2sqlsetup -o -C";
if ($::databaseloc) {
$cmd = "DATABASELOC=$::databaseloc $::XCATROOT/bin/db2sqlsetup -o -C";
} else {
$cmd = "$::XCATROOT/bin/db2sqlsetup -o -C";
}
$msg = "odbcsetup: Running Client ODBC setup. \"$cmd\"\n";
`logger -t xcat $msg`;