From 511333cf41bc5245a0f1086bc000c44d93276866 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 25 Aug 2010 15:30:21 +0000 Subject: [PATCH] add setup to autostart after reboot git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7229 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/db2sqlsetup | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/xCAT-server/sbin/db2sqlsetup b/xCAT-server/sbin/db2sqlsetup index 55ecd940e..2158a186d 100755 --- a/xCAT-server/sbin/db2sqlsetup +++ b/xCAT-server/sbin/db2sqlsetup @@ -321,12 +321,12 @@ if (($::INIT) && ($::xcatrunningdb2 == 0)) if ($::SERVER) { &db2start; - } - # - # Setup DB2 to restart on reboot (TBD) - # - #&db2reboot; + # + # Setup DB2 to restart on reboot + # + &db2reboot; + } } @@ -1006,7 +1006,7 @@ sub createxcatdb =head3 db2reboot - Setup for db2 to start on reboot (TBD) + Setup for db2 to start on reboot =cut @@ -1014,8 +1014,17 @@ sub createxcatdb sub db2reboot { + xCAT::MsgUtils->message("I", "Setting up DB2 to start on reboot"); my $cmd; + # su to xcatdb + $cmd = "db2iauto -on xcatdb "; + my $rc = &rundb2cmd($cmd); + if ($rc != 0) + { + xCAT::MsgUtils->message("W", " $cmd failed."); + + } } #-----------------------------------------------------------------------------