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

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 136
Merged at revision: 136
Proposed branch: lp:~allenap/maas/bind-in-knots-bug-1066929
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 20 lines (+4/-6)
1 file modified
debian/maas-dns.postinst (+4/-6)
To merge this branch: bzr merge lp:~allenap/maas/bind-in-knots-bug-1066929
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+129868@code.launchpad.net

Commit message

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

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Looks good.

Note that each "cycle" adds a new line but it's the fault of the get_named_conf command.

i.e.: after 3 cycles, the conf file looks like this:

"""
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

include "/etc/bind/maas/named.conf.maas";
"""

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/maas-dns.postinst'
2--- debian/maas-dns.postinst 2012-10-11 18:16:28 +0000
3+++ debian/maas-dns.postinst 2012-10-16 12:28:24 +0000
4@@ -17,12 +17,10 @@
5 chmod 600 /etc/bind/maas/rndc.conf.maas
6 fi
7
8- # add the required line to "/etc/bind/named.conf.local"
9- if ! grep -qs "^include.*\/etc\/bind\/maas\;$" /etc/bind/maas.conf.local; then
10- include_path=$(maas get_named_conf | grep "include\ [a-z\"\/\.]\+;")
11- sed -i "\$a $include_path" \
12- /etc/bind/named.conf.local
13- fi
14+ # remove any existing MAAS-related include line from
15+ # /etc/bind/named.conf.local, then re-add it.
16+ sed -i '/^include\s.*maas/d' /etc/bind/named.conf.local
17+ maas get_named_conf --edit --config_path /etc/bind/named.conf.local
18
19 if [ -x /usr/sbin/invoke-rc.d ]; then
20 invoke-rc.d bind9 restart || true

Subscribers

People subscribed via source and target branches