Merge lp:~julian-edwards/maas/packaging.trunk into lp:~maas-maintainers/maas/packaging

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: 292
Merged at revision: 290
Proposed branch: lp:~julian-edwards/maas/packaging.trunk
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 87 lines (+28/-20)
2 files modified
debian/changelog (+3/-2)
debian/maas-region-controller.postinst (+25/-18)
To merge this branch: bzr merge lp:~julian-edwards/maas/packaging.trunk
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+228914@code.launchpad.net

Commit message

Ensure that logging is reconfigured on package upgrades so that the new syslog logging works.

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

lgtm. Lines 75, 82-85 require have funny indentation.

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

> lgtm. Lines 75, 82-85 require have funny indentation.

ARGH. Bloody TABS in the file.

291. By Julian Edwards

use TABS, argh

292. By Julian Edwards

use TABS, argh

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-07-29 10:51:48 +0000
3+++ debian/changelog 2014-07-30 17:17:16 +0000
4@@ -1,4 +1,4 @@
5-maas (1.6+bzr2367-0ubuntu3) UNRELEASED; urgency=medium
6+maas (1.6+bzr2367-0ubuntu4) UNRELEASED; urgency=medium
7
8 * UNRELEASED
9
10@@ -41,8 +41,9 @@
11 debian/maas-region-controller-min.postinst
12 debian/maas-region-controller.postinst
13 - Install /var/log/maas/maas.log as a syslog file.
14+ - Ensure logging is set up for upgrades
15
16- -- Julian Edwards <julian.edwards@canonical.com> Tue, 29 Jul 2014 11:49:39 +0100
17+ -- Julian Edwards <julian.edwards@canonical.com> Wed, 30 Jul 2014 18:07:50 +0100
18
19 maas (1.5+bzr2252-0ubuntu1) trusty; urgency=medium
20
21
22=== modified file 'debian/maas-region-controller.postinst'
23--- debian/maas-region-controller.postinst 2014-07-29 11:35:17 +0000
24+++ debian/maas-region-controller.postinst 2014-07-30 17:17:16 +0000
25@@ -144,6 +144,27 @@
26 /usr/share/maas/conf/99-maas
27 }
28
29+configure_logging() {
30+ # Give appropriate permissions
31+ if [ ! -f /var/log/maas/maas-django.log ]; then
32+ touch /var/log/maas/maas-django.log
33+ fi
34+ chown -R maas:maas /var/log/maas
35+ chmod -R 775 /var/log/maas/oops
36+
37+ # Main syslog file.
38+ if [ ! -f /var/log/maas/maas.log ]; then
39+ touch /var/log/maas/maas.log
40+ fi
41+ chown syslog:syslog /var/log/maas/maas.log
42+
43+ # Create log directory base
44+ mkdir -p /var/log/maas/rsyslog
45+ chown -R syslog:syslog /var/log/maas/rsyslog
46+ # Make sure rsyslog reads our config
47+ invoke-rc.d rsyslog restart
48+}
49+
50 if [ "$1" = "configure" ] && [ -z "$2" ]; then
51 #########################################################
52 ################ Folder Permissions ####################
53@@ -188,24 +209,7 @@
54 ################ Configure Logging ####################
55 #########################################################
56
57- # Give appropriate permissions
58- if [ ! -f /var/log/maas/maas-django.log ]; then
59- touch /var/log/maas/maas-django.log
60- fi
61- chown -R maas:maas /var/log/maas
62- chmod -R 775 /var/log/maas/oops
63-
64- # Main syslog file.
65- if [ ! -f /var/log/maas/maas.log ]; then
66- touch /var/log/maas/maas.log
67- fi
68- chown syslog:syslog /var/log/maas/maas.log
69-
70- # Create log directory base
71- mkdir -p /var/log/maas/rsyslog
72- chown -R syslog:syslog /var/log/maas/rsyslog
73- # Make sure rsyslog reads our config
74- invoke-rc.d rsyslog restart
75+ configure_logging
76
77 #########################################################
78 ################### Squid-deb-proxy ####################
79@@ -261,6 +265,9 @@
80 configure_maas_txlongpoll_rabbitmq_user
81
82 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
83+ # Logging changed at r2611, ensure it is set up.
84+ configure_logging
85+
86 # If upgrading to any later package version, then upgrade db.
87 invoke-rc.d apache2 stop || true
88

Subscribers

People subscribed via source and target branches