CLOUDSTACK-5986: Fix dnsmasq lease for VPC

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a253ff24
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a253ff24
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a253ff24

Branch: refs/heads/4.3
Commit: a253ff24682a7d405bfa8428a0833423bf19f9b9
Parents: 2fe7aee
Author: Sheng Yang <[email protected]>
Authored: Tue Mar 11 16:13:30 2014 -0700
Committer: Sheng Yang <[email protected]>
Committed: Tue Mar 11 16:15:08 2014 -0700

----------------------------------------------------------------------
 .../patches/debian/config/etc/init.d/cloud-early-config   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a253ff24/systemvm/patches/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
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 77e0f17..9152df2 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
 }
 
 

Reply via email to