Updated Branches:
  refs/heads/master 921f783a8 -> 66d761506

CLOUDSTACK-4132 current dnsmasq config does not allow guest virtual 
machines(clients) to update its hostnames with a DNS server

Introducing the option dhcp-client-update fails if the dnsmasq version is less 
than 2.6 (like in older templates).
Added a check for the version in cloud-early-config. will add 
dhcp-client-update option in the config file only
if the dnsmasq version is 2.6 and above.

Signed-off-by: Jayapal <[email protected]>


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

Branch: refs/heads/master
Commit: 66d76150657cd0e8d44e5be8307b8c59327b686d
Parents: 921f783
Author: Bharat Kumar <[email protected]>
Authored: Sat Aug 17 10:58:23 2013 +0530
Committer: Jayapal <[email protected]>
Committed: Mon Aug 19 11:15:06 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66d76150/patches/systemvm/debian/config/etc/init.d/cloud-early-config
----------------------------------------------------------------------
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 736234c..5aa9621 100755
--- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config
+++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config
@@ -724,6 +724,15 @@ setup_dnsmasq() {
       then
        echo "$ETH0_IP6 data-server" >> /etc/hosts
   fi
+#add the dhcp-client-update only if dnsmasq version is 2.6 and above
+  dnsmasqVersion=$(dnsmasq -v |  grep version -m 1 | grep -o  
"[[:digit:]]\.[[:digit:]]")
+  major=$(echo "$dnsmasqVersion" | cut -d '.' -f 1)
+  minor=$(echo "$dnsmasqVersion" | cut -d '.' -f 2)
+  if [ "$major" -eq '2' -a  "$minor" -ge '6' ] || [ "$major" -gt '2' ]
+  then
+      sed -i -e "/^dhcp-client-update/d" /etc/dnsmasq.conf
+      echo 'dhcp-client-update' >> /etc/dnsmasq.conf
+  fi
 }
 
 setup_sshd(){

Reply via email to