From 4091399a5898714e6e6297b6cea4ce26e03d51fa Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 30 Dec 2010 12:25:27 +0000 Subject: [PATCH] fix defect 3145930 mysqlsetup retoring when no dump taken git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8532 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/mysqlsetup | 46 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index c49e4de5e..1532cf4b9 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -337,20 +337,20 @@ if ($::INIT) # create cfgloc file # &createcfgloc; + + # + # Restore backed up database into MySQL + # + &restorexcatdb; + + if ($::osname eq 'AIX') + { + xCAT::MsgUtils->message("I", "xCAT is now running on the MySQL database.\nYou should log out and back in, so that the new ulimit settings will take affect."); + } else { + xCAT::MsgUtils->message("I", "xCAT is now running on the MySQL database."); + } } - # - # Restore backed up database into MySQL - # - &restorexcatdb; - - if ($::osname eq 'AIX') - { - xCAT::MsgUtils->message("I", "xCAT is now running on the MySQL database.\nYou should log out and back in, so that the new ulimit settings will take affect."); - } else { - xCAT::MsgUtils->message("I", "xCAT is now running on the MySQL database."); - } - } # end initialization if ($::SETUPODBC) @@ -1584,7 +1584,6 @@ sub createcfgloc } -#----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -1602,28 +1601,25 @@ sub restorexcatdb # copy the mysql cfgloc file my $cmd; - if ($::xcatrunningmysql == 0) - { # xcat cfgloc not configured - # if they had an old cfgloc on another database, save it - if ((-e ("/etc/xcat/cfgloc")) && (!(-e ("/etc/xcat/cfgloc.olddb")))) - { + # if they had an old cfgloc on another database, save it + if ((-e ("/etc/xcat/cfgloc")) && (!(-e ("/etc/xcat/cfgloc.olddb")))) + { $cmd = "cp /etc/xcat/cfgloc /etc/xcat/cfgloc.olddb"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { xCAT::MsgUtils->message("E", " $cmd failed."); } - } + } - # put in place cfgloc for mysql - $cmd = "cp /etc/xcat/cfgloc.mysql /etc/xcat/cfgloc"; - xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { + # put in place cfgloc for mysql + $cmd = "cp /etc/xcat/cfgloc.mysql /etc/xcat/cfgloc"; + xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { xCAT::MsgUtils->message("E", " $cmd failed."); exit(1); - } } # allow readonly by root