From 3ae22b59d24a07e5a2eb46132e05278a235bbbd9 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 11 Aug 2010 13:29:46 +0000 Subject: [PATCH] add additional LL requirement to the setup script git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7043 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/db2sqlsetup | 56 +++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/xCAT-server/sbin/db2sqlsetup b/xCAT-server/sbin/db2sqlsetup index e5aeac8a8..a6e7f656a 100755 --- a/xCAT-server/sbin/db2sqlsetup +++ b/xCAT-server/sbin/db2sqlsetup @@ -333,6 +333,10 @@ if (($::INIT) && ($::xcatrunningdb2 == 0)) # On server, xcat not already configured to run DB2 add xCAT database if (($::SERVER) && ($::xcatrunningdb2 == 0)) { + # + # update DBM config + # + &updateDBM; # # Create the xcatdb database @@ -722,7 +726,13 @@ sub setupinstance } # su to xcatdb and run more setup - $cmd = "db2set -all "; + $cmd = "echo \"EXTSHM=ON\" >> /var/lib/db2/sqllib/db2profile "; + $rc = &rundb2cmd($cmd); + if ($rc != 0) + { + xCAT::MsgUtils->message("I", " $cmd warning."); + } + $cmd = "echo \"export EXTSHM\" >>/var/lib/db2/sqllib/db2profile "; $rc = &rundb2cmd($cmd); if ($rc != 0) { @@ -739,6 +749,20 @@ sub setupinstance xCAT::MsgUtils->message("E", " $cmd failed."); exit(1); } + # su to xcatdb and run more setup + $cmd = "echo \"EXTSHM=ON\" >> /var/lib/db2/sqllib/db2profile "; + $rc = &rundb2cmd($cmd); + if ($rc != 0) + { + xCAT::MsgUtils->message("I", " $cmd warning."); + } + $cmd = "echo \"export EXTSHM\" >>/var/lib/db2/sqllib/db2profile "; + $rc = &rundb2cmd($cmd); + if ($rc != 0) + { + xCAT::MsgUtils->message("I", " $cmd warning."); + } + } } } @@ -792,6 +816,7 @@ sub setupdb2env open(FILE, ">>/etc/profile") or die "cannot open file /etc/profile\n"; print FILE "export DB2INSTANCE=xcatdb \n"; + print FILE "export EXTSHM=ON \n"; close FILE; } @@ -805,6 +830,7 @@ sub setupdb2env open(FILE, ">>/etc/profile.d/xcat.sh") or die "cannot open file /etc/profile.d/xcat.sh\n"; print FILE "export DB2INSTANCE=xcatdb \n"; + print FILE "export EXTSHM=ON \n"; close FILE; } my $cmd = "egrep -i \"DB2INSTANCE\" /etc/profile.d/xcat.csh"; @@ -814,6 +840,7 @@ sub setupdb2env open(FILE, ">>/etc/profile.d/xcat.csh") or die "cannot open file /etc/profile.d/xcat.csh\n"; print FILE "setenv DB2INSTANCE \"xcatdb\" \n"; + print FILE "setenv EXTSHM \"ON\" \n"; close FILE; } @@ -887,8 +914,35 @@ sub catalogServer $rc = &rundb2cmd($cmd); } +#----------------------------------------------------------------------------- + +=head3 updateDBM + + + Setup configuration requirements for the DBM + +=cut #----------------------------------------------------------------------------- + +sub updateDBM +{ + xCAT::MsgUtils->message("I", + "Updating the DBM."); + my $cmd; + my $rc = 0; + + # su to xcatdb to update the DBM + $cmd = "db2 -tvf /opt/xcat/share/xcat/tools/updateDBM.sql "; + $rc = &rundb2cmd($cmd); + if ($rc != 0) + { + xCAT::MsgUtils->message("I", " $cmd warning."); + } + + +} + #----------------------------------------------------------------------------- =head3 createxcatdb