hooks/update-zone: add command to reload pdns-recursor zones

This commit is contained in:
root 2014-10-24 00:09:22 +02:00
parent 4ad6fa387f
commit 1e67ccaf9d

View File

@ -12,7 +12,6 @@ CONTAINER_DATA = LXC_ROOT.join("container.json")
LXC_ZONE = ZONE_PATH.join("lxc.zone")
DNS_CONTAINER = "dns"
def atomic_write(path, content)
temp_path = path.to_s + ".tmp"
File.open(temp_path, 'w+') do |f|
@ -82,4 +81,4 @@ atomic_write(v4_rdns_path, v4_rdns_zone)
atomic_write(v6_rdns_path, v6_rdns_zone)
atomic_write(CONTAINER_DATA, JSON.pretty_generate(json))
system("lxc-attach", "-n", DNS_CONTAINER, "--", "rndc", "reload")
system("lxc-attach", "-e", "-n", DNS_CONTAINER, "--", "rec_control", "reload-zones")