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;