From a253ff24682a7d405bfa8428a0833423bf19f9b9 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Tue, 11 Mar 2014 16:13:30 -0700 Subject: [PATCH] CLOUDSTACK-5986: Fix dnsmasq lease for VPC --- .../debian/config/etc/init.d/cloud-early-config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index 77e0f17361f..9152df24cc7 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -1042,6 +1042,16 @@ EOF sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf #answer all local domain queries sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf + + command -v dhcp_release > /dev/null 2>&1 + no_dhcp_release=$? + if [ $no_dhcp_release -eq 0 ] + then + echo 1 > /var/cache/cloud/dnsmasq_managed_lease + sed -i -e "/^leasefile-ro/d" /etc/dnsmasq.conf + else + echo 0 > /var/cache/cloud/dnsmasq_managed_lease + fi }