Merge lp:~allenap/maas/packaging.regiond into lp:~maas-maintainers/maas/packaging

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 351
Merged at revision: 339
Proposed branch: lp:~allenap/maas/packaging.regiond
Merge into: lp:~maas-maintainers/maas/packaging
Prerequisite: lp:~allenap/maas/packaging.rename-scripts-and-prepare-for-twistd-in-region
Diff against target: 297 lines (+80/-53)
11 files modified
debian/changelog (+31/-1)
debian/control (+1/-1)
debian/maas-cluster-controller.maas-clusterd.upstart (+2/-6)
debian/maas-region-controller-min.apport (+17/-14)
debian/maas-region-controller-min.install (+3/-3)
debian/maas-region-controller-min.logrotate (+0/-8)
debian/maas-region-controller-min.maas-regiond.upstart (+19/-0)
debian/maas-region-controller-min.postinst (+2/-3)
debian/maas-region-controller.postinst (+3/-3)
debian/patches/01-fix-database-settings.patch (+1/-14)
debian/rules (+1/-0)
To merge this branch: bzr merge lp:~allenap/maas/packaging.regiond
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+241003@code.launchpad.net

Commit message

Packaging for maas-regiond.

Description of the change

From the changelog:

  * debian/maas-region-controller-min.maas-regiond.upstart
    - Upstart script for the new maas-regiond.
    - Use setuid/setgid to drop root privs before running script.
    - Don't write a pid file.
  * debian/maas-cluster-controller.maas-clusterd.upstart
    - Start maas-clusterd; it's no longer called maas-pserv.
  * debian/maas-region-controller-min.install
    - Don't install wsgi.py; it's no longer used.
  * debian/rules
    - Install maas-regiond plugin.
  * debian/maas-region-controller-min.apport
    debian/maas-region-controller-min.logrotate
    debian/maas-region-controller-min.postinst
    debian/maas-region-controller.postinst
    - Change maas-django.log to regiond.log.
  * debian/maas-region-controller.postinst
    - Restart maas-regiond after installation.
  * debian/maas-region-controller.postinst
    - Restart maas-regiond after installation.
  * debian/control
    debian/maas-region-controller-min.postinst
    debian/maas-region-controller.postinst
    - mod_wsgi is no longer used.
  * debian/maas-region-controller-min.logrotate
    - No longer used; maas-regiond uses rotatelogs.
  * debian/patches/01-fix-database-settings.patch
    - Move STATIC_ROOT setting upstream.
    - Simplify database configuration hunk.

To post a comment you must log in.
lp:~allenap/maas/packaging.regiond updated
346. By Gavin Panella

Merged packaging.rename-scripts-and-prepare-for-twistd-in-region into packaging.regiond, resolving conflicts.

347. By Gavin Panella

STATIC_ROOT no longer needs patching.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Overall, it looks good to me. The only thing missing is handling upgrades, but that's something I can take care of on a different branch once this gets merged, as long as fresh installs work just fine!

Other than that, see minor comments inline to get this merged.

review: Needs Fixing
lp:~allenap/maas/packaging.regiond updated
348. By Gavin Panella

Merge trunk.

349. By Gavin Panella

Fix-up changelog.

350. By Gavin Panella

Increase log file rotation threshold to 10MB.

351. By Gavin Panella

No need to restart maas-regiond; DEBHELPER does it for us.

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

Thanks Andres. I've addressed your comments. Can you take another look?

Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm! I still don't feel confident of having log rotation on the upstart job, as I've never seen that been done before. However, we can give it a try and if not, change it at any later time.

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 2014-12-17 16:03:58 +0000
3+++ debian/changelog 2015-01-13 18:02:57 +0000
4@@ -16,6 +16,36 @@
5
6 * debian/control: Tighten Dependency versioning of some packages.
7
8+ [ Gavin Panella ]
9+ * debian/maas-region-controller-min.maas-regiond.upstart
10+ - Upstart script for the new maas-regiond.
11+ - Use setuid/setgid to drop root privs before running script.
12+ - Don't write a pid file.
13+ * debian/maas-cluster-controller.maas-clusterd.upstart
14+ - Start maas-clusterd; it's no longer called maas-pserv.
15+ * debian/maas-region-controller-min.install
16+ - Don't install wsgi.py; it's no longer used.
17+ * debian/rules
18+ - Install maas-regiond plugin.
19+ * debian/maas-region-controller-min.apport
20+ debian/maas-region-controller-min.logrotate
21+ debian/maas-region-controller-min.postinst
22+ debian/maas-region-controller.postinst
23+ - Change maas-django.log to regiond.log.
24+ * debian/maas-region-controller.postinst
25+ - Restart maas-regiond after installation.
26+ * debian/maas-region-controller.postinst
27+ - Restart maas-regiond after installation.
28+ * debian/control
29+ debian/maas-region-controller-min.postinst
30+ debian/maas-region-controller.postinst
31+ - mod_wsgi is no longer used.
32+ * debian/maas-region-controller-min.logrotate
33+ - No longer used; maas-regiond uses rotatelogs.
34+ * debian/patches/01-fix-database-settings.patch
35+ - Move STATIC_ROOT setting upstream.
36+ - Simplify database configuration hunk.
37+
38 -- Andres Rodriguez <andreserl@ubuntu.com> Fri, 14 Nov 2014 09:04:29 -0500
39
40 maas (1.7.0+bzr3299-0ubuntu1) utopic; urgency=medium
41@@ -117,7 +147,7 @@
42 debian/maas-cluster-controller.install
43 debian/maas-cluster-controller.postinst
44 - Reflect Celery removal changes made in trunk r3067.
45- - Don't install celeryconfig_cluster.py any longer.
46+ - Don't install celeryconfig_cluster.py any longer.
47 - Don't install maas_local_celeryconfig_cluster.py any longer.
48 - Don't symlink maas_local_celeryconfig_cluster.py from /etc to /usr.
49 - Don't insert UUID into maas_local_celeryconfig_cluster.py.
50
51=== modified file 'debian/control'
52--- debian/control 2014-12-17 18:32:22 +0000
53+++ debian/control 2015-01-13 18:02:57 +0000
54@@ -48,10 +48,10 @@
55 Package: maas-region-controller-min
56 Architecture: all
57 Depends: apache2,
58+ apache2-utils,
59 bind9utils,
60 dbconfig-common,
61 iproute,
62- libapache2-mod-wsgi,
63 libjs-raphael,
64 libjs-yui3-full,
65 libjs-yui3-min,
66
67=== modified file 'debian/maas-cluster-controller.maas-clusterd.upstart'
68--- debian/maas-cluster-controller.maas-clusterd.upstart 2014-10-15 11:11:37 +0000
69+++ debian/maas-cluster-controller.maas-clusterd.upstart 2015-01-13 18:02:57 +0000
70@@ -1,8 +1,4 @@
71-# maas-cluster - provisioning service
72-#
73-# MAAS Provisioning Service
74-
75-description "MAAS"
76+description "MAAS Cluster Controller"
77 author "Andres Rodriguez <andres.rodriguez@canonical.com>"
78
79 start on filesystem and net-device-up
80@@ -51,5 +47,5 @@
81 # To add options to your daemon, edit the line below:
82 exec /usr/bin/authbind --deep /usr/bin/twistd \
83 --nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \
84- --logfile=/dev/null maas-pserv --config-file=/etc/maas/pserv.yaml
85+ --logfile=/dev/null maas-clusterd --config-file=/etc/maas/pserv.yaml
86 end script
87
88=== modified file 'debian/maas-region-controller-min.apport'
89--- debian/maas-region-controller-min.apport 2014-09-25 17:50:15 +0000
90+++ debian/maas-region-controller-min.apport 2015-01-13 18:02:57 +0000
91@@ -2,7 +2,7 @@
92
93 '''apport hook for maas-region-controller
94
95-(c) 2012 Canonical Ltd.
96+(c) 2012-2014 Canonical Ltd.
97 Author: Andres Rodriguez <andres.rodriguez@canonical.com>
98
99 This program is free software; you can redistribute it and/or modify it
100@@ -12,25 +12,28 @@
101 the full text of the license.
102 '''
103
104-from apport.hookutils import *
105+from apport.hookutils import (
106+ attach_conffiles,
107+ attach_file_if_exists,
108+ attach_related_packages,
109+)
110+
111
112 def add_info(report, ui):
113- response = ui.yesno("The contents of your /etc/maas/maas_local_settings.py, "
114- "/etc/maas/pserv.yaml files "
115- "may help developers diagnose your bug more "
116- "quickly. However, it may contain sensitive "
117- "information. Do you want to include it in your "
118- "bug report?")
119+ response = ui.yesno(
120+ "The contents of your /etc/maas/maas_local_settings.py, "
121+ "/etc/maas/pserv.yaml files may help developers diagnose your bug "
122+ "more quickly. However, it may contain sensitive information. Do "
123+ "you want to include it in your bug report?")
124
125- if response == None: # user cancelled
126+ if response is None: # user cancelled
127 raise StopIteration
128-
129- elif response == True:
130- attach_conffiles(report,'maas')
131+ elif response is True:
132+ attach_conffiles(report, 'maas')
133
134 # Attaching log files
135- attach_file_if_exists(report, '/var/log/maas/maas-django.log', 'MAASLog')
136- attach_file_if_exists(report, '/var/log/maas/pserv.log', 'MAASPservLog')
137+ attach_file_if_exists(report, '/var/log/maas/regiond.log', 'MAASRegionLog')
138+ attach_file_if_exists(report, '/var/log/maas/pserv.log', 'MAASClusterLog')
139
140 # Attaching related packages info
141 attach_related_packages(report, ['python-django-maas', 'apparmor'])
142
143=== modified file 'debian/maas-region-controller-min.install'
144--- debian/maas-region-controller-min.install 2014-09-25 20:19:36 +0000
145+++ debian/maas-region-controller-min.install 2015-01-13 18:02:57 +0000
146@@ -10,9 +10,6 @@
147 # Install MAAS local settings
148 debian/tmp/etc/maas/maas_local_settings.py
149
150-# Install WSGI
151-debian/tmp/usr/share/maas/wsgi.py
152-
153 # Install new preseed files
154 debian/tmp/etc/maas/preseeds
155
156@@ -27,6 +24,9 @@
157 # Install winrm certificate generation script
158 debian/tmp/usr/bin/maas-generate-winrm-cert
159
160+# Install twisted plugins
161+twisted/plugins/maasregiond.py usr/share/pyshared/twisted/plugins
162+
163 # Install all other stuff
164 debian/extras/maas-region-admin usr/sbin
165 debian/extras/20-maas.conf etc/rsyslog.d
166
167=== removed file 'debian/maas-region-controller-min.logrotate'
168--- debian/maas-region-controller-min.logrotate 2014-09-25 17:50:15 +0000
169+++ debian/maas-region-controller-min.logrotate 1970-01-01 00:00:00 +0000
170@@ -1,8 +0,0 @@
171-/var/log/maas/maas-django.log {
172- rotate 5
173- weekly
174- compress
175- copytruncate
176- missingok
177- #create 620 root www-data
178-}
179
180=== added file 'debian/maas-region-controller-min.maas-regiond.upstart'
181--- debian/maas-region-controller-min.maas-regiond.upstart 1970-01-01 00:00:00 +0000
182+++ debian/maas-region-controller-min.maas-regiond.upstart 2015-01-13 18:02:57 +0000
183@@ -0,0 +1,19 @@
184+description "MAAS Region Controller"
185+author "Gavin Panella <gavin.panella@canonical.com>"
186+
187+start on filesystem and net-device-up
188+stop on runlevel [016]
189+
190+setuid maas
191+setgid maas
192+
193+respawn
194+
195+env DJANGO_SETTINGS_MODULE=maas.settings
196+env PYTHONPATH=/usr/share/maas
197+env LOGFILE=/var/log/maas/regiond.log
198+
199+script
200+ exec /usr/bin/twistd --nodaemon --pidfile= maas-regiond 2>&1 | \
201+ /usr/bin/rotatelogs -f -L "${LOGFILE}" "${LOGFILE}" 10M
202+end script
203
204=== modified file 'debian/maas-region-controller-min.postinst'
205--- debian/maas-region-controller-min.postinst 2014-09-25 20:19:36 +0000
206+++ debian/maas-region-controller-min.postinst 2015-01-13 18:02:57 +0000
207@@ -27,7 +27,6 @@
208 # enable apache modules needed
209 a2enmod proxy_http
210 a2enmod expires
211- a2enmod wsgi
212 }
213
214 configure_maas_default_url() {
215@@ -88,8 +87,8 @@
216 #########################################################
217
218 # Give appropriate permissions
219- if [ ! -f /var/log/maas/maas-django.log ]; then
220- touch /var/log/maas/maas-django.log
221+ if [ ! -f /var/log/maas/regiond.log ]; then
222+ touch /var/log/maas/regiond.log
223 fi
224 chown -R maas:maas /var/log/maas
225 chmod -R 775 /var/log/maas/oops
226
227=== modified file 'debian/maas-region-controller.postinst'
228--- debian/maas-region-controller.postinst 2014-10-10 12:27:35 +0000
229+++ debian/maas-region-controller.postinst 2015-01-13 18:02:57 +0000
230@@ -41,7 +41,6 @@
231 # enable apache modules needed
232 a2enmod proxy_http
233 a2enmod expires
234- a2enmod wsgi
235 }
236
237 configure_maas_database() {
238@@ -74,8 +73,8 @@
239
240 configure_logging() {
241 # Give appropriate permissions
242- if [ ! -f /var/log/maas/maas-django.log ]; then
243- touch /var/log/maas/maas-django.log
244+ if [ ! -f /var/log/maas/regiond.log ]; then
245+ touch /var/log/maas/regiond.log
246 fi
247 chown -R maas:maas /var/log/maas
248 chmod -R 775 /var/log/maas/oops
249@@ -207,6 +206,7 @@
250 fi
251
252 invoke-rc.d apache2 restart || true
253+invoke-rc.d maas-regiond restart || true
254
255 if [ -f /etc/init/maas-clusterd.conf ]; then
256 invoke-rc.d maas-clusterd restart || true
257
258=== modified file 'debian/patches/01-fix-database-settings.patch'
259--- debian/patches/01-fix-database-settings.patch 2014-11-21 20:25:45 +0000
260+++ debian/patches/01-fix-database-settings.patch 2015-01-13 18:02:57 +0000
261@@ -1,17 +1,6 @@
262 --- a/contrib/maas_local_settings.py
263 +++ b/contrib/maas_local_settings.py
264-@@ -7,7 +7,7 @@
265- DEFAULT_MAAS_URL = "http://maas.internal.example.com/"
266-
267- # Absolute path to the directory static files should be collected to.
268--STATIC_ROOT = '/var/lib/maas/static/'
269-+STATIC_ROOT = '/usr/share/maas/web/static/'
270-
271- # Prefix to use for MAAS's urls.
272- # If FORCE_SCRIPT_NAME is None (the default), all the urls will start with
273-@@ -78,9 +78,9 @@
274- 'default': {
275- # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' etc.
276+@@ -78,5 +78,5 @@
277 'ENGINE': 'django.db.backends.postgresql_psycopg2',
278 - 'NAME': '',
279 - 'USER': '',
280@@ -20,5 +9,3 @@
281 + 'USER': 'maas',
282 + 'PASSWORD': 'maas',
283 'HOST': 'localhost',
284- }
285- }
286
287=== modified file 'debian/rules'
288--- debian/rules 2014-12-17 14:57:43 +0000
289+++ debian/rules 2015-01-13 18:02:57 +0000
290@@ -10,6 +10,7 @@
291
292 override_dh_installinit:
293 dh_installinit --name maas-clusterd
294+ dh_installinit --name maas-regiond
295 dh_installinit --name maas-dhcpd
296 dh_installinit --name maas-dhcpd6
297 dh_installinit --name maas-proxy

Subscribers

People subscribed via source and target branches