Setup - Fix HOSTNAME race condition

This commit is contained in:
Mike Reeves
2019-12-12 21:12:20 -05:00
parent 3b4e371505
commit 9b1f5abc22
2 changed files with 2 additions and 2 deletions

View File

@@ -1156,6 +1156,8 @@ set_hostname() {
echo "127.0.0.1 $HOSTNAME $HOSTNAME.localdomain localhost localhost.localdomain localhost4 localhost4.localdomain" > /etc/hosts
echo "::1 localhost localhost.localdomain localhost6 localhost6.localdomain6" >> /etc/hosts
echo $HOSTNAME > /etc/hostname
HOSTNAME=$(cat /etc/hostname)
MINION_ID=$(echo $HOSTNAME | awk -F. {'print $1'})
if [ $INSTALLTYPE != 'MASTERONLY' ] || [ $INSTALLTYPE != 'EVALMODE' ] || [ $INSTALLTYPE == 'HELIXSENSOR' ]; then
if [[ $TESTHOST = *"not found"* ]] || [[ $TESTHOST = *"connection timed out"* ]]; then
if ! grep -q $MSRVIP /etc/hosts; then

View File

@@ -153,8 +153,6 @@ if (whiptail_you_sure) ; then
RULESETUP=ETOPEN
whiptail_make_changes
set_hostname
HOSTNAME=$(cat /etc/hostname)
MINION_ID=$(echo $HOSTNAME | awk -F. {'print $1'})
clear_master
mkdir -p /nsm
get_filesystem_root