diff --git a/xCAT/postscripts/db2install b/xCAT/postscripts/db2install index 2721ec3aa..ce2a5da67 100755 --- a/xCAT/postscripts/db2install +++ b/xCAT/postscripts/db2install @@ -19,6 +19,7 @@ Needs export MASTER=site.master export DB2INSTALLLOC=site.db2installlloc export DATABASELOC=site.databaseloc + export INSTALLDIR=site.installdir export XCATDPORT=site.xcatdport export NODE= @@ -74,6 +75,18 @@ chomp $::hname; $::MN = $ENV{'MASTER'}; # as known by the node $::databaseloc = $ENV{'DATABASELOC'}; # directory for db instance +my $installdir = $ENV{'INSTALLDIR'}; # installdir + +# check to see if the databaseloc attribute is in the installdir attribute +# directory path. If it is error out and send something to syslog +my @installlocdir = split '/', $installdir; # get base of installdir +my @dblocdir = split '/',$::databaseloc; # get base of database +if ($installlocdir[1] eq $dblocdir[1] ) { # if they match,error + my $msg="db2install:The site databaseloc attribute is set to the directory or a sub-directory of the site table installloc or installdir attribute or the default of /install. This is not a supported configuration."; + `logger -t xcat $msg`; + exit(1); +} + if ($::osname eq 'AIX') { $::installdb2dir = "/opt/IBM/db2/V9.7"; # default @@ -89,7 +102,7 @@ my $msg; my $db2install = $::installdb2dir; $db2install .= "\/instance"; if (!(-e ($db2install))) -{ # already installed +{ # not already installed $::db2installloc = $ENV{'DB2INSTALLLOC'}; if (!$::db2installloc) {