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

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 134
Merged at revision: 133
Proposed branch: lp:~andreserl/maas/package_update_bzr1264
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 231 lines (+47/-74)
9 files modified
debian/changelog (+3/-1)
debian/maas-cluster-controller.postinst (+0/-17)
debian/maas-cluster-controller.postrm (+0/-4)
debian/maas-common.postinst (+22/-0)
debian/maas-common.postrm (+13/-0)
debian/maas-dns.postinst (+0/-17)
debian/maas-region-controller.config (+9/-10)
debian/maas-region-controller.postinst (+0/-20)
debian/maas-region-controller.postrm (+0/-5)
To merge this branch: bzr merge lp:~andreserl/maas/package_update_bzr1264
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Launchpad code reviewers Pending
Review via email: mp+129280@code.launchpad.net

Commit message

Handle creation of user/group in maas-common.
debian/maas-region-controller.config: Always source dbconfig scripts.

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

Approving myself as this has been tested by rvba and me

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 2012-10-11 16:22:44 +0000
3+++ debian/changelog 2012-10-11 18:54:20 +0000
4@@ -1,4 +1,4 @@
5-maas (0.1+bzr1263+dfsg-0ubuntu1) UNRELEASED; urgency=low
6+maas (0.1+bzr1264+dfsg-0ubuntu1) UNRELEASED; urgency=low
7
8 * New upstream release.
9
10@@ -15,6 +15,8 @@
11 * debian/control: Depends on maas-region-controller for maas-dns.
12 * debian/maas-region-controller.postinst: Set the correct host for
13 BROKER_URL (LP: #1065080)
14+ * Handle creation of user/group in maas-common.
15+ * debian/maas-region-controller.config: Always source dbconfig scripts.
16
17 -- Andres Rodriguez <andreserl@ubuntu.com> Wed, 10 Oct 2012 11:17:21 -0400
18
19
20=== modified file 'debian/maas-cluster-controller.postinst'
21--- debian/maas-cluster-controller.postinst 2012-10-10 16:08:56 +0000
22+++ debian/maas-cluster-controller.postinst 2012-10-11 18:54:20 +0000
23@@ -3,21 +3,6 @@
24 . /usr/share/debconf/confmodule
25 db_version 2.0
26
27-add_user_group(){
28- local user="maas"
29- local group="maas"
30- if ! getent group "$group" >/dev/null; then
31- addgroup --quiet --system "$group" || true
32- fi
33- if ! getent passwd "$user" > /dev/null 2>&1; then
34- adduser --quiet \
35- --system \
36- --group \
37- --no-create-home \
38- "$user" || true
39- fi
40-}
41-
42 create_log_dir() {
43 # create log dir
44 if [ ! -d /var/lib/maas ]; then
45@@ -33,8 +18,6 @@
46 }
47
48 if [ "$1" = "configure" ] && [ -z "$2" ]; then
49- add_user_group
50-
51 # logging
52 create_log_dir
53
54
55=== modified file 'debian/maas-cluster-controller.postrm'
56--- debian/maas-cluster-controller.postrm 2012-10-10 16:08:56 +0000
57+++ debian/maas-cluster-controller.postrm 2012-10-11 18:54:20 +0000
58@@ -7,10 +7,6 @@
59
60 case "$1" in
61 purge)
62- # Deleting user/group
63- if getent passwd maas >/dev/null; then
64- deluser maas || true
65- fi
66 # remove log directory
67 if [ -d /var/log/maas ]; then
68 rm -rf /var/log/maas
69
70=== added file 'debian/maas-common.postinst'
71--- debian/maas-common.postinst 1970-01-01 00:00:00 +0000
72+++ debian/maas-common.postinst 2012-10-11 18:54:20 +0000
73@@ -0,0 +1,22 @@
74+#!/bin/sh -e
75+
76+add_user_group(){
77+ local user="maas"
78+ local group="maas"
79+ if ! getent group "$group" >/dev/null; then
80+ addgroup --quiet --system "$group" || true
81+ fi
82+ if ! getent passwd "$user" > /dev/null 2>&1; then
83+ adduser --quiet \
84+ --system \
85+ --group \
86+ --no-create-home \
87+ "$user" || true
88+ fi
89+}
90+
91+if [ "$1" = "configure" ]; then
92+ add_user_group
93+fi
94+
95+#DEBHELPER#
96
97=== added file 'debian/maas-common.postrm'
98--- debian/maas-common.postrm 1970-01-01 00:00:00 +0000
99+++ debian/maas-common.postrm 2012-10-11 18:54:20 +0000
100@@ -0,0 +1,13 @@
101+#!/bin/sh
102+
103+set -e
104+
105+case "$1" in
106+ purge)
107+ # Deleting user/group
108+ if getent passwd maas >/dev/null; then
109+ deluser maas || true
110+ fi
111+esac
112+
113+#DEBHELPER#
114
115=== modified file 'debian/maas-dns.postinst'
116--- debian/maas-dns.postinst 2012-10-03 01:46:42 +0000
117+++ debian/maas-dns.postinst 2012-10-11 18:54:20 +0000
118@@ -1,23 +1,6 @@
119 #!/bin/sh -e
120
121-add_user_group(){
122- local user="maas"
123- local group="maas"
124- if ! getent group "$group" >/dev/null; then
125- addgroup --quiet --system "$group" || true
126- fi
127- if ! getent passwd "$user" > /dev/null 2>&1; then
128- adduser --quiet \
129- --system \
130- --group \
131- --no-create-home \
132- "$user" || true
133- fi
134-}
135-
136 if ([ "$1" = "configure" ] && [ -z "$2" ]) || [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
137- add_user_group
138-
139 # If /etc/bind/maas is empty, set_up_dns.
140 if [ ! "$(ls -A /etc/bind/maas)" ]; then
141 maas set_up_dns
142
143=== modified file 'debian/maas-region-controller.config'
144--- debian/maas-region-controller.config 2012-09-28 02:40:23 +0000
145+++ debian/maas-region-controller.config 2012-10-11 18:54:20 +0000
146@@ -16,22 +16,21 @@
147 fi
148 }
149
150+# source dbconfig-common shell library, and call the hook function
151+if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
152+ . /usr/share/dbconfig-common/dpkg/config.pgsql
153+fi
154
155 if ([ "$1" = "configure" ] && [ -z "$2" ]); then
156 # Hide maas/dbconfig-install question by setting default.
157 set_question maas-region-controller/dbconfig-install true
158 set_question maas-region-controller/pgsql/app-pass ""
159
160- # source dbconfig-common shell library, and call the hook function
161- if [ -f /usr/share/dbconfig-common/dpkg/config.pgsql ]; then
162- . /usr/share/dbconfig-common/dpkg/config.pgsql
163-
164- dbc_dbname="maasdb"
165- dbc_dbuser="maas"
166- dbc_remove="true"
167-
168- dbc_go maas-region-controller $@
169- fi
170+ dbc_dbname="maasdb"
171+ dbc_dbuser="maas"
172+ dbc_remove="true"
173+
174+ dbc_go maas-region-controller $@
175
176 elif [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
177 db_get maas/default-maas-url || true
178
179=== modified file 'debian/maas-region-controller.postinst'
180--- debian/maas-region-controller.postinst 2012-10-11 16:22:44 +0000
181+++ debian/maas-region-controller.postinst 2012-10-11 18:54:20 +0000
182@@ -45,21 +45,6 @@
183 fi
184 }
185
186-add_user_group(){
187- local user="maas"
188- local group="maas"
189- if ! getent group "$group" >/dev/null; then
190- addgroup --quiet --system "$group" || true
191- fi
192- if ! getent passwd "$user" > /dev/null 2>&1; then
193- adduser --quiet \
194- --system \
195- --group \
196- --no-create-home \
197- "$user" || true
198- fi
199-}
200-
201 configure_maas_txlongpoll_rabbitmq_user() {
202 local longpoll_user="maas_longpoll"
203 local longpoll_pass=
204@@ -151,11 +136,6 @@
205
206 if [ "$1" = "configure" ] && [ -z "$2" ]; then
207 #########################################################
208- ################ User/Group Creatiion ##################
209- #########################################################
210- add_user_group
211-
212- #########################################################
213 ################ Folder Permissions ####################
214 #########################################################
215 mkdir -p /var/lib/maas/media/storage
216
217=== modified file 'debian/maas-region-controller.postrm'
218--- debian/maas-region-controller.postrm 2012-10-05 04:26:58 +0000
219+++ debian/maas-region-controller.postrm 2012-10-11 18:54:20 +0000
220@@ -26,11 +26,6 @@
221 /etc/init.d/apache2 restart || true
222 fi
223
224- # Deleting user/group
225- if getent passwd maas >/dev/null; then
226- deluser maas || true
227- fi
228-
229 # Delete symlink
230 if [ -L /etc/tgt/conf.d/maas.conf ]; then
231 rm -rf /etc/tgt/conf.d/maas.conf

Subscribers

People subscribed via source and target branches

to all changes: