Merge ~andreserl/maas:disable_nginx_on_install into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 3a04eee73a5c9fd5a38816d40273d418d9cca60b
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:disable_nginx_on_install
Merge into: maas:master
Diff against target: 44 lines (+13/-0)
2 files modified
debian/maas-rack-controller.postinst (+7/-0)
debian/maas-rack-controller.postrm (+6/-0)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+352423@code.launchpad.net

Commit message

debian/maas-rack-controller.postinst,postrm: Disable/enable nginx

MAAS now depends on nginx. Since the package automatically binds to port 80, MAAS enables/disables it on install/remove accordingly.

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
1diff --git a/debian/maas-rack-controller.postinst b/debian/maas-rack-controller.postinst
2index bec6b65..1b0b4b5 100644
3--- a/debian/maas-rack-controller.postinst
4+++ b/debian/maas-rack-controller.postinst
5@@ -147,11 +147,17 @@ fix_dns_permissions() {
6 fi
7 }
8
9+disable_nginx() {
10+ systemctl stop nginx >/dev/null 2>&1 || true
11+ systemctl disable nginx >/dev/null 2>&1 || true
12+}
13+
14 # Unconditionally ensure that there is at least an empty configuration
15 # file. This does *not* overwrite any existing configuration.
16 maas-rack config
17
18 if [ "$1" = "configure" ] && [ -z "$2" ]; then
19+ disable_nginx
20 configure_logging
21 configure_libdir
22 configure_maas_url
23@@ -178,6 +184,7 @@ elif [ -n "$DEBCONF_RECONFIGURE" ]; then
24 configure_shared_secret
25
26 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
27+ disable_nginx
28 configure_logging
29 configure_libdir
30 maas-rack upgrade-cluster
31diff --git a/debian/maas-rack-controller.postrm b/debian/maas-rack-controller.postrm
32index 6a73639..aa28f1a 100644
33--- a/debian/maas-rack-controller.postrm
34+++ b/debian/maas-rack-controller.postrm
35@@ -48,3 +48,9 @@ esac
36 if [ -L /etc/tgt/conf.d/maas.conf ]; then
37 rm -rf /etc/tgt/conf.d/maas.conf
38 fi
39+
40+# MAAS installation disables system nginx so it doesn't
41+# prevent MAAS from running our own nginx daemon. As such,
42+# on removal, reenable nginx.
43+systemctl enable nginx >/dev/null 2>&1 || true
44+systemctl start nginx >/dev/null 2>&1 || true

Subscribers

People subscribed via source and target branches