← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~allenap/maas/bind-in-knots-bug-1066929 into lp:~maas-maintainers/maas/packaging

 

Gavin Panella has proposed merging lp:~allenap/maas/bind-in-knots-bug-1066929 into lp:~maas-maintainers/maas/packaging.

Commit message:
Remove MAAS-related include lines from named's config before adding new.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1066929 in maas (Ubuntu): "duplicate entry added to named.conf.local on each package reconfigure"
  https://bugs.launchpad.net/ubuntu/+source/maas/+bug/1066929

For more details, see:
https://code.launchpad.net/~allenap/maas/bind-in-knots-bug-1066929/+merge/129868
-- 
https://code.launchpad.net/~allenap/maas/bind-in-knots-bug-1066929/+merge/129868
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/maas/bind-in-knots-bug-1066929 into lp:~maas-maintainers/maas/packaging.
=== modified file 'debian/maas-dns.postinst'
--- debian/maas-dns.postinst	2012-10-11 18:16:28 +0000
+++ debian/maas-dns.postinst	2012-10-16 12:28:24 +0000
@@ -17,12 +17,10 @@
         chmod 600 /etc/bind/maas/rndc.conf.maas
     fi
 
-    # add the required line to "/etc/bind/named.conf.local"
-    if ! grep -qs "^include.*\/etc\/bind\/maas\;$" /etc/bind/maas.conf.local; then
-        include_path=$(maas get_named_conf | grep "include\ [a-z\"\/\.]\+;")
-        sed -i "\$a $include_path" \
-            /etc/bind/named.conf.local
-    fi
+    # remove any existing MAAS-related include line from
+    # /etc/bind/named.conf.local, then re-add it.
+    sed -i '/^include\s.*maas/d' /etc/bind/named.conf.local
+    maas get_named_conf --edit --config_path /etc/bind/named.conf.local
 
     if [ -x /usr/sbin/invoke-rc.d ]; then
         invoke-rc.d bind9 restart || true


Follow ups