From 7576e04e2419dcaeeaf4edc5a516ade16dd03a78 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Wed, 6 Jun 2018 15:25:11 +0800 Subject: [PATCH] let mysqlsetup work when using alias IP as MN IP (#5279) * let mysqlsetup work when using alias IP as MN IP --- xCAT-client/bin/mysqlsetup | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index b8936aa30..36a39b86c 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -338,6 +338,7 @@ if ((($odbconly == 0) && ($::xcatrunningmysql == 0)) || $::UPDATE || $::SETUPLL) } # initial setup request, if not already running mysql +my $hostfile_configured=0; if (($::INIT) && ($::xcatrunningmysql == 0)) { # MySQL not running, then initialize the database @@ -443,6 +444,12 @@ if (($::INIT) && ($::xcatrunningmysql == 0)) # &createcfgloc; + if ($::HOSTFILE) + { + &addhosts; + $hostfile_configured=1 + } + # # Restore backed up database into MySQL # @@ -481,7 +488,7 @@ if ($::SETUPLL) # if input a list of hosts to add to the database, to give access to MySQL -if ($::HOSTFILE) +if (($::HOSTFILE) && ($hostfile_configured == 0)) { &addhosts;