summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2016-08-11 14:48:23 +0200
committerStefan Fritsch <sf@sfritsch.de>2016-08-11 21:38:35 +0200
commit37c6a13032d17ebe51e22932e542d637c54394c5 (patch)
tree9463092caacfce7a87ef8f490db726bd48d002ef
parentdc1769e234fca5b1f16b8a624d588fee2b037914 (diff)
downloadapache2-37c6a13032d17ebe51e22932e542d637c54394c5.tar.gz
apache2_switch_mpm: check if admin has disabled the mpm
Don't override the local admin's action if the requested mpm has been disabled by the admin. This may not be perfect, because we don't check if the current mpm has been enabled by the admin. But on the other hand, the admin-installed state is also set for the mpm that has been active during the 2.2 -> 2.4 update. So there may not be an alternative.
-rw-r--r--debian/changelog3
-rw-r--r--debian/debhelper/apache2-maintscript-helper24
2 files changed, 20 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog
index d9d2f4f0..5cf71df3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ apache2 (2.4.23-3) UNRELEASED; urgency=low
* Also restore re-introduced *.load files for mod_ident, mod_imagemap, and
mod_cern_meta. These may have gone missing due to dpkg thinking they still
belong to apache2.2-common. Reported by Markus Waldeck.
+ * apache2-maintscript-helper: Make apache2_switch_mpm do nothing if the
+ local admin has disabled the requested mpm manually.
+ Closes: #827446, #799630
* Make mod_proxy_html depend on mod_xml2enc.
-- Stefan Fritsch <sf@debian.org> Wed, 10 Aug 2016 11:25:02 +0200
diff --git a/debian/debhelper/apache2-maintscript-helper b/debian/debhelper/apache2-maintscript-helper
index 91c3489a..58ae4e01 100644
--- a/debian/debhelper/apache2-maintscript-helper
+++ b/debian/debhelper/apache2-maintscript-helper
@@ -286,16 +286,26 @@ apache2_switch_mpm()
return 1
fi
- local CUR_MPM=$(a2query -M) || return 1
+ local a2query_ret=0
+ a2query -m "$mpm_$MPM" > /dev/null 2>&1 || a2query_ret=$?
- if [ "$CUR_MPM" != "$MPM" ] ; then
- a2dismod -m -q "mpm_$CUR_MPM";
- a2enmod -m -q "mpm_$MPM";
- apache2_msg "info" "apache2_switch_mpm Switch to $MPM"
- else
+ case $a2query_ret in
+ 0)
apache2_msg "info" "apache2_switch_mpm $MPM: No action required"
return 0
- fi
+ ;;
+ 32)
+ apache2_msg "info" "apache2_switch_mpm $MPM: Has been disabled manually, not changing"
+ return 1
+ ;;
+
+ esac
+
+ local CUR_MPM=$(a2query -M) || return 1
+
+ a2dismod -m -q "mpm_$CUR_MPM";
+ a2enmod -m -q "mpm_$MPM";
+ apache2_msg "info" "apache2_switch_mpm Switch to $MPM"
if ! apache2_has_module "mpm_$MPM" ; then
# rollback