elements ubuntu-guest and fedora-guest mess up /etc/hosts

Bug #1529471 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Medium
Amrith Kumar

Bug Description

These elements contain the following code:

amrith@amrith-work:/opt/stack/trove-integration/scripts/files/elements$ grep -r hostname .
./ubuntu-guest/pre-install.d/60-loopback-host:host_name=`hostname`
./fedora-guest/post-install.d/60-loopback-host:host_name=`hostname`
amrith@amrith-work:/opt/stack/trove-integration/scripts/files/elements$ more ./ubuntu-guest/pre-install.d/60-loopback-host
#!/bin/bash
set -e
set -o xtrace

# CONTEXT: HOST after IMAGE BUILD as SCRIPT USER
# PURPOSE: Set the loopback network in host file

host_name=`hostname`
echo "127.0.0.1 ${host_name}" >> /etc/hosts
amrith@amrith-work:/opt/stack/trove-integration/scripts/files/elements$ more ./fedora-guest/post-install.d/60-loopback-host
#!/bin/bash
set -e
set -o xtrace

# CONTEXT: HOST after IMAGE BUILD as SCRIPT USER
# PURPOSE: Set the loopback network in host file

host_name=`hostname`
echo "127.0.0.1 ${host_name}" >> /etc/hosts
amrith@amrith-work:/opt/stack/trove-integration/scripts/files/elements$

The end result is that the /etc/hosts file on a machine ends up looking like this (shown from an ubuntu machine)

hadoop@h1:~$ more /etc/hosts
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.0.1 amrith-work
127.0.1.1 h1.novalocal h1

The issue is with the penultimate line, 127.0.0.1 should NOT point to the name of the machine where the guest image was built!

Amrith Kumar (amrith)
Changed in trove:
importance: Undecided → Medium
Amrith Kumar (amrith)
summary: - elements ubuntu-guest and fedora-guest mess up /etchosts
+ elements ubuntu-guest and fedora-guest mess up /etc/hosts
Revision history for this message
Amrith Kumar (amrith) wrote :
Changed in trove:
status: New → In Progress
Craig Vyvial (cp16net)
Changed in trove:
milestone: none → mitaka-3
Amrith Kumar (amrith)
Changed in trove:
status: In Progress → Fix Committed
Amrith Kumar (amrith)
Changed in trove:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.