Fix unbound on rax centos6 nodes.

Rax centos6 nodes are dynamically configured via static file injection.
During boot our rc.local script runs to set resolv.conf nameserver to
127.0.0.1 then the ifup-post script runs and overwrites this
information with the "static" info in the ifcfg-* files. Modify the
ifcfg-* files in rc.local to prevent them from updating the nameservers
in resolv.conf.

Change-Id: I532e9fa4c40e0e0ce2aad35f4ae1f385a0619b70
This commit is contained in:
Clark Boylan 2014-08-20 18:01:41 -07:00
parent 031b18f63a
commit 1a321b7a2f

View File

@ -83,9 +83,14 @@ fi
# Overwrite /etc/resolv.conf at boot
sudo dd of=/etc/rc.local <<EOF
#!/bin/bash
set -e
set -o xtrace
# Some providers inject dynamic network config statically. Work around this
# for DNS nameservers. This is expected to fail on some nodes so remove -e.
set +e
sed -i -e 's/^\(DNS[0-9]*=[.0-9]\+\)/#\1/g' /etc/sysconfig/network-scripts/ifcfg-*
set -e
echo 'nameserver 127.0.0.1' > /etc/resolv.conf
exit 0