Merge lp:~andreserl/maas/fix_dns into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Merged at revision: 385
Proposed branch: lp:~andreserl/maas/fix_dns
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 56 lines (+14/-7)
2 files modified
debian/changelog (+1/-0)
debian/maas-dns.postinst (+13/-7)
To merge this branch: bzr merge lp:~andreserl/maas/fix_dns
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+257426@code.launchpad.net

Commit message

debian/maas-dns.postinst: Ensure permissions are fixed also on upgrade.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

selfie!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-04-24 18:05:29 +0000
3+++ debian/changelog 2015-04-24 18:37:39 +0000
4@@ -4,6 +4,7 @@
5 was making systemd crash (LP: #1446699)
6 * debian/maas-proxy.maas-proxy.service: Fix proxy to correctly run
7 pre-start script.
8+ * debian/maas-dns.postinst: Ensure permissions are fixed also on upgrade.
9
10 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 21 Apr 2015 13:00:49 -0400
11
12
13=== modified file 'debian/maas-dns.postinst'
14--- debian/maas-dns.postinst 2015-04-22 19:48:01 +0000
15+++ debian/maas-dns.postinst 2015-04-24 18:37:39 +0000
16@@ -2,13 +2,7 @@
17
18 set -e
19
20-if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ -n "$DEBCONF_RECONFIGURE" ]; then
21- # If /etc/bind/maas is empty, set_up_dns.
22- if [ ! "$(ls -A /etc/bind/maas)" ]; then
23- maas-region-admin set_up_dns
24- fi
25-
26- # Fix permissions.
27+fix_dns_permissions(){
28 if [ -d /etc/bind/maas ]; then
29 chown -R maas:root /etc/bind/maas
30 fi
31@@ -27,6 +21,17 @@
32 chown maas:bind /etc/bind/maas/named.conf.rndc.maas
33 chmod 640 /etc/bind/maas/named.conf.rndc.maas
34 fi
35+}
36+
37+# This handles installs and re-configuration
38+if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ -n "$DEBCONF_RECONFIGURE" ]; then
39+ # If /etc/bind/maas is empty, set_up_dns.
40+ if [ ! "$(ls -A /etc/bind/maas)" ]; then
41+ maas-region-admin set_up_dns
42+ fi
43+
44+ # Fix permissions.
45+ fix_dns_permissions
46
47 # Remove any existing MAAS-related include line from
48 # /etc/bind/named.conf.local, then re-add it.
49@@ -46,6 +51,7 @@
50 maas-region-admin edit_named_options --config-path /etc/bind/named.conf.options
51 invoke-rc.d bind9 restart || true
52 fi
53+ fix_dns_permissions
54 fi
55
56 #DEBHELPER#

Subscribers

People subscribed via source and target branches

to all changes: