Commit e03b4467 authored by David Johnson's avatar David Johnson

Fix new "requirement" triggered by neutron-ovs-cleanup.

Some services assume they can resolve the hostname prior to network
being up (i.e. neutron-ovs-cleanup).  neutron-ovs-cleanup in particular
seems to not allow the ovs bridges to forward until it finishes.  This
is very bad.  So, to workaround, put the real control net ip and FQDN
into /etc/hosts too, both statically at setup (so it is there for the
first reboot), and in the rc.hostnames hook (so it is there after future
reboots).
parent 1e7cf3e0
......@@ -50,6 +50,9 @@ if [ "$HOSTNAME" = "$NETWORKMANAGER" ]; then
# (These were created one-time in setup-lib.sh)
#
cat $OURDIR/mgmt-hosts > /etc/hosts.tmp
# Some services assume they can resolve the hostname prior to network being
# up (i.e. neutron-ovs-cleanup; see setup-ovs-node.sh).
echo $MYIP `hostname` >> /etc/hosts.tmp
cp -p /etc/hosts $OURDIR/hosts.orig
cat $OURDIR/hosts.orig >> /etc/hosts.tmp
mv /etc/hosts.tmp /etc/hosts
......
......@@ -262,7 +262,8 @@ done
#
# Set the hostname for later after reboot!
#
echo `hostname` > /etc/hostname
hostname=`hostname`
echo $hostname > /etc/hostname
service_restart openvswitch-switch
......@@ -271,6 +272,13 @@ ip route flush cache
# Just wait a bit
#sleep 8
# Some services (neutron-ovs-cleanup) might lookup the hostname prior to
# network being up. We have to handle this here once at startup; then
# again later in the rc.hostnames hook below.
echo $ctlip $hostname >> /tmp/hosts.tmp
cat /etc/hosts >> /tmp/hosts.tmp
mv /tmp/hosts.tmp /etc/hosts
grep -q DYNRUNDIR /etc/emulab/paths.sh
if [ $? -eq 0 ]; then
echo "*** Hooking Emulab rc.hostnames boot script..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment