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 2785816331d..69c1daa8dc4 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -325,7 +325,7 @@ setup_redundant_router() { sed -i "s/\[ETH2IP\]/$ETH2_IP/g" /root/redundant_router/enable_pubip.sh sed -i "s/\[GATEWAY\]/$GW/g" /root/redundant_router/enable_pubip.sh sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived - grep "sleep 10;" /etc/init.d/keepalived > /dev/null + #grep "sleep 10;" /etc/init.d/keepalived > /dev/null if [ $? -ne 0 ] then sed -i "s/if\ start-stop-daemon\ --start/sleep\ 10;if\ start-stop-daemon\ --start/g" /etc/init.d/keepalived diff --git a/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh b/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh index 7d95d8bc12d..8adcca49a96 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh @@ -72,15 +72,16 @@ routing_svcs() { chkconfig cloud off chkconfig cloud-passwd-srvr on ; chkconfig haproxy on ; - chkconfig dnsmasq on chkconfig ssh on chkconfig nfs-common off chkconfig portmap off if [ $RROUTER -eq 0 ] then + chkconfig dnsmasq off chkconfig postinit on echo "postinit" > /var/cache/cloud/enabled_svcs else + chkconfig dnsmasq on chkconfig keepalived off chkconfig conntrackd off fi diff --git a/patches/systemvm/debian/config/root/edithosts.sh b/patches/systemvm/debian/config/root/edithosts.sh index ae4fcfb598b..478ce4ba552 100755 --- a/patches/systemvm/debian/config/root/edithosts.sh +++ b/patches/systemvm/debian/config/root/edithosts.sh @@ -25,6 +25,9 @@ # $2 : the associated ip address # $3 : the hostname +grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null +no_redundant=$? + wait_for_dnsmasq () { local _pid=$(pidof dnsmasq) for i in 0 1 2 3 4 5 6 7 8 9 10 @@ -34,10 +37,12 @@ wait_for_dnsmasq () { [ "$_pid" != "" ] && break; done [ "$_pid" != "" ] && return 0; - echo "edithosts: timed out waiting for dnsmasq to start" + logger -t cloud "edithosts: timed out waiting for dnsmasq to start" return 1 } +logger -t cloud "edithosts: update $1 $2 $3 to hosts" + [ ! -f /etc/dhcphosts.txt ] && touch /etc/dhcphosts.txt [ ! -f /var/lib/misc/dnsmasq.leases ] && touch /var/lib/misc/dnsmasq.leases @@ -68,7 +73,12 @@ if [ "$pid" != "" ] then service dnsmasq restart else - wait_for_dnsmasq + if [ $no_redundant -eq 1 ] + then + wait_for_dnsmasq + else + logger -t cloud "edithosts: skip wait dnsmasq due to redundant virtual router" + fi fi exit $?