diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index d4af3a95755..258e71e24a9 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -597,6 +597,11 @@ setup_vpcrouter() { setup_vmware_extra_nics fi + if [ -f /etc/hosts ]; then + host=`hostname -s`; + grep -q $host /etc/hosts || echo "127.0.0.1 $host" >> /etc/hosts; + fi + cat > /etc/network/interfaces << EOF auto lo $1 iface lo inet loopback @@ -814,18 +819,9 @@ change_password() { fi } -set_etc_hosts() { - if [ -f /etc/hosts ]; then - host=`hostname -s`; - grep -q $host /etc/hosts || echo "127.0.0.1 $host" >> /etc/hosts; - fi -} - start() { # Clear /tmp for file lock rm -f /tmp/*.lock - # fix lookups for our hostname (iptables, etc) - set_etc_hosts local hyp=$(hypervisor) [ $? -ne 0 ] && log_it "Failed to detect hypervisor type, bailing out of early init" && exit 10 log_it "Detected that we are running inside $hyp guest"