Merge ~andreserl/maas:drop_apache into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: c6386e30e1394531ca9c7d7f57f7b04719d450e9
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:drop_apache
Merge into: maas:master
Diff against target: 183 lines (+12/-52)
8 files modified
debian/changelog (+3/-0)
debian/control (+1/-2)
debian/maas-region-api.postinst (+0/-25)
debian/maas-region-api.postrm (+0/-19)
debian/maas-region-api.preinst (+8/-0)
debian/maas-region-api.prerm (+0/-2)
debian/maas-region-controller.postinst (+0/-3)
debian/maas-region-controller.prerm (+0/-1)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
MAAS Lander Approve
Review via email: mp+336668@code.launchpad.net

Commit message

Drop usage of apache2 as starting from 2.4 it will no longer be supported.

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b drop_apache lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: c6386e30e1394531ca9c7d7f57f7b04719d450e9

review: Approve
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Hurray!!! This made my day!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index d8c0ac4..56e188b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,6 +1,9 @@
6 maas (2.4.0~alpha1-0ubuntu1) UNRELEASED; urgency=medium
7
8 * UNRELEASED
9+ * debian/*: Drop usage of apache2. It has long been used to maintain
10+ backwards compat for 1.x versions of MAAS, but starting from 2.4, it
11+ will no longer be supported.
12
13 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 21 Nov 2017 10:30:54 -0500
14
15diff --git a/debian/control b/debian/control
16index 383c395..67a6e15 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -68,8 +68,7 @@ Description: MAAS server common files
20
21 Package: maas-region-api
22 Architecture: all
23-Depends: apache2,
24- bind9utils,
25+Depends: bind9utils,
26 iproute2,
27 libjs-angularjs,
28 libjs-yui3-full,
29diff --git a/debian/maas-region-api.postinst b/debian/maas-region-api.postinst
30index 900caa4..7e512c4 100644
31--- a/debian/maas-region-api.postinst
32+++ b/debian/maas-region-api.postinst
33@@ -7,20 +7,6 @@ db_version 2.0
34
35 RELEASE=`lsb_release -rs` || RELEASE=""
36
37-configure_region_http() {
38- # handle apache configs
39- if [ -e /usr/share/maas/maas-http.conf -a \
40- ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
41- ln -sf /usr/share/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
42- fi
43-
44- # enable apache modules needed
45- a2enmod proxy_http
46- a2enmod proxy_wstunnel
47- a2enmod expires
48- a2enmod rewrite
49-}
50-
51 configure_logging() {
52 # Give appropriate permissions
53 if [ ! -f /var/log/maas/regiond.log ]; then
54@@ -36,8 +22,6 @@ configure_logging() {
55 # destination folder.
56 systemctl restart rsyslog >/dev/null 2>&1 || true
57
58- # apache2 log symlinks
59- ln -sf /var/log/apache2 /var/log/maas/
60 }
61
62 configure_libdir() {
63@@ -58,7 +42,6 @@ configure_libdir() {
64 maas-region local_config_set
65
66 if [ "$1" = "configure" ] && [ -z "$2" ]; then
67- configure_region_http
68 configure_logging
69 configure_libdir
70
71@@ -67,16 +50,8 @@ elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0
72 configure_logging
73 configure_libdir
74
75- # If upgrading to any later package version, then upgrade db.
76- invoke-rc.d apache2 stop || true
77-
78- # make sure maas http config is symlinked
79- configure_region_http
80-
81 fi
82
83-invoke-rc.d apache2 restart || true
84-
85 db_stop
86
87 #DEBHELPER#
88diff --git a/debian/maas-region-api.postrm b/debian/maas-region-api.postrm
89index a37547b..9739968 100644
90--- a/debian/maas-region-api.postrm
91+++ b/debian/maas-region-api.postrm
92@@ -10,30 +10,11 @@ case "$1" in
93 purge)
94 # Remove logging files & foldesr
95 rm -rf /var/log/maas/regiond.log*
96- rm -rf /var/log/maas/apache2
97 rm -rf /var/log/maas/rsyslog
98
99 # Remove libgdir related files
100 rm -rf /var/lib/maas/media
101
102- case $RELEASE in
103- 12.04|12.10|13.04)
104- if [ -h /etc/apache2/conf.d/maas-http.conf ]; then
105- rm -rf /etc/apache2/conf.d/maas-http.conf
106- fi
107- ;;
108- *)
109- if [ -h /etc/apache2/conf-enabled/maas-http.conf ]; then
110- rm -rf /etc/apache2/conf-enabled/maas-http.conf
111- fi
112- ;;
113- esac
114-
115- # Restarting apache2
116- if [ -x /usr/sbin/invoke-rc.d ]; then
117- invoke-rc.d apache2 restart || true
118- fi
119-
120 # Delete symlink
121 if [ -L /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas ]; then
122 rm -rf /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas
123diff --git a/debian/maas-region-api.preinst b/debian/maas-region-api.preinst
124index d4d0709..30a8704 100644
125--- a/debian/maas-region-api.preinst
126+++ b/debian/maas-region-api.preinst
127@@ -34,5 +34,13 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
128 mv /etc/maas/templates /etc/maas/templates.maas-old
129 fi
130
131+ if [ -f /etc/apache2/conf-enabled/maas-http.conf ]; then
132+ rm -rf /etc/apache2/conf-enabled/maas-http.conf
133+ fi
134+
135+ if [ -d /var/log/maas/apache2 ]; then
136+ rm -rf /var/log/maas/apache2
137+ fi
138+
139 fi
140 #DEBHELPER#
141diff --git a/debian/maas-region-api.prerm b/debian/maas-region-api.prerm
142index ea71d9a..0ae7a18 100644
143--- a/debian/maas-region-api.prerm
144+++ b/debian/maas-region-api.prerm
145@@ -5,5 +5,3 @@ set -e
146 . /usr/share/debconf/confmodule
147
148 #DEBHELPER#
149-
150-invoke-rc.d apache2 stop || true
151diff --git a/debian/maas-region-controller.postinst b/debian/maas-region-controller.postinst
152index c698c88..c4d6c28 100644
153--- a/debian/maas-region-controller.postinst
154+++ b/debian/maas-region-controller.postinst
155@@ -144,8 +144,6 @@ elif [ -n "$DEBCONF_RECONFIGURE" ]; then
156
157 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
158 # If upgrading to any later package version, then upgrade db.
159- deb-systemd-invoke restart apache2 || true
160-
161 # make sure postgresql is running
162 restart_postgresql
163
164@@ -183,7 +181,6 @@ fi
165
166 deb-systemd-invoke enable maas-regiond >/dev/null || true
167 deb-systemd-invoke restart maas-regiond >/dev/null || true
168-deb-systemd-invoke restart apache2 || true
169
170 if [ -f /lib/systemd/system/maas-rackd.service ]; then
171 deb-systemd-invoke restart maas-rackd >/dev/null || true
172diff --git a/debian/maas-region-controller.prerm b/debian/maas-region-controller.prerm
173index b636dd8..a7fbc34 100644
174--- a/debian/maas-region-controller.prerm
175+++ b/debian/maas-region-controller.prerm
176@@ -6,7 +6,6 @@ set -e
177
178 #DEBHELPER#
179
180-invoke-rc.d apache2 stop || true
181 invoke-rc.d maas-regiond stop || true
182
183 . /usr/share/dbconfig-common/dpkg/prerm.pgsql

Subscribers

People subscribed via source and target branches