From 9b1f5abc22e61c84521ba3fe76113ab161568128 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Thu, 12 Dec 2019 21:12:20 -0500 Subject: [PATCH] Setup - Fix HOSTNAME race condition --- setup/functions.sh | 2 ++ setup/so-setup.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/functions.sh b/setup/functions.sh index 6f68b0428..5303c5fbc 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -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 diff --git a/setup/so-setup.sh b/setup/so-setup.sh index f4a87aec1..219ec589d 100644 --- a/setup/so-setup.sh +++ b/setup/so-setup.sh @@ -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