From 66d76150657cd0e8d44e5be8307b8c59327b686d Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Sat, 17 Aug 2013 10:58:23 +0530 Subject: [PATCH] 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 --- .../systemvm/debian/config/etc/init.d/cloud-early-config | 9 +++++++++ 1 file changed, 9 insertions(+) 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 736234c724e..5aa96218a06 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(){