mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 11:04:00 +01:00
Fix dhcp_entry.sh fail on redundant router
And don't worry about "chkconfig dnsmasq off", because keepalived script should take care of it.
This commit is contained in:
parent
dc116d99a8
commit
02049d4cd4
@ -325,7 +325,7 @@ setup_redundant_router() {
|
|||||||
sed -i "s/\[ETH2IP\]/$ETH2_IP/g" /root/redundant_router/enable_pubip.sh
|
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/\[GATEWAY\]/$GW/g" /root/redundant_router/enable_pubip.sh
|
||||||
sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived
|
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 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
sed -i "s/if\ start-stop-daemon\ --start/sleep\ 10;if\ start-stop-daemon\ --start/g" /etc/init.d/keepalived
|
sed -i "s/if\ start-stop-daemon\ --start/sleep\ 10;if\ start-stop-daemon\ --start/g" /etc/init.d/keepalived
|
||||||
|
|||||||
@ -72,15 +72,16 @@ routing_svcs() {
|
|||||||
chkconfig cloud off
|
chkconfig cloud off
|
||||||
chkconfig cloud-passwd-srvr on ;
|
chkconfig cloud-passwd-srvr on ;
|
||||||
chkconfig haproxy on ;
|
chkconfig haproxy on ;
|
||||||
chkconfig dnsmasq on
|
|
||||||
chkconfig ssh on
|
chkconfig ssh on
|
||||||
chkconfig nfs-common off
|
chkconfig nfs-common off
|
||||||
chkconfig portmap off
|
chkconfig portmap off
|
||||||
if [ $RROUTER -eq 0 ]
|
if [ $RROUTER -eq 0 ]
|
||||||
then
|
then
|
||||||
|
chkconfig dnsmasq off
|
||||||
chkconfig postinit on
|
chkconfig postinit on
|
||||||
echo "postinit" > /var/cache/cloud/enabled_svcs
|
echo "postinit" > /var/cache/cloud/enabled_svcs
|
||||||
else
|
else
|
||||||
|
chkconfig dnsmasq on
|
||||||
chkconfig keepalived off
|
chkconfig keepalived off
|
||||||
chkconfig conntrackd off
|
chkconfig conntrackd off
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -25,6 +25,9 @@
|
|||||||
# $2 : the associated ip address
|
# $2 : the associated ip address
|
||||||
# $3 : the hostname
|
# $3 : the hostname
|
||||||
|
|
||||||
|
grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null
|
||||||
|
no_redundant=$?
|
||||||
|
|
||||||
wait_for_dnsmasq () {
|
wait_for_dnsmasq () {
|
||||||
local _pid=$(pidof dnsmasq)
|
local _pid=$(pidof dnsmasq)
|
||||||
for i in 0 1 2 3 4 5 6 7 8 9 10
|
for i in 0 1 2 3 4 5 6 7 8 9 10
|
||||||
@ -34,10 +37,12 @@ wait_for_dnsmasq () {
|
|||||||
[ "$_pid" != "" ] && break;
|
[ "$_pid" != "" ] && break;
|
||||||
done
|
done
|
||||||
[ "$_pid" != "" ] && return 0;
|
[ "$_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
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger -t cloud "edithosts: update $1 $2 $3 to hosts"
|
||||||
|
|
||||||
[ ! -f /etc/dhcphosts.txt ] && touch /etc/dhcphosts.txt
|
[ ! -f /etc/dhcphosts.txt ] && touch /etc/dhcphosts.txt
|
||||||
[ ! -f /var/lib/misc/dnsmasq.leases ] && touch /var/lib/misc/dnsmasq.leases
|
[ ! -f /var/lib/misc/dnsmasq.leases ] && touch /var/lib/misc/dnsmasq.leases
|
||||||
|
|
||||||
@ -68,7 +73,12 @@ if [ "$pid" != "" ]
|
|||||||
then
|
then
|
||||||
service dnsmasq restart
|
service dnsmasq restart
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
exit $?
|
exit $?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user