summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoren Hansen <soren.hansen@rackspace.com>2010-09-27 12:14:20 +0200
committerSoren Hansen <soren.hansen@rackspace.com>2010-09-27 12:14:20 +0200
commit47cccfc21dfd4c1acf74b6d84ced8abba8c40e76 (patch)
treee8f353e1159ce167e848c11c33ef9bf9eba76bae
parente70948dbec0b21664739b2b7cdb1cc3da92bd01b (diff)
Ensure dnsmasq can read updates to dnsmasq conffile.
-rw-r--r--nova/network/linux_net.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index 9d5bd8495..7d708968c 100644
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -150,9 +150,14 @@ def update_dhcp(context, network_id):
signal causing it to reload, otherwise spawn a new instance
"""
network_ref = db.network_get(context, network_id)
- with open(_dhcp_file(network_ref['vlan'], 'conf'), 'w') as f:
+
+ conffile = _dhcp_file(network_ref['vlan'], 'conf')
+ with open(conffile, 'w') as f:
f.write(get_dhcp_hosts(context, network_id))
+ # Make sure dnsmasq can actually read it (it setuid()s to "nobody")
+ os.chmod(conffile, 0644)
+
pid = _dnsmasq_pid_for(network_ref['vlan'])
# if dnsmasq is already running, then tell it to reload