[apache2] 04/06: apache2_switch_mpm: check if admin has disabled the mpm

Stefan Fritsch sf at moszumanska.debian.org
Thu Aug 11 20:07:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

sf pushed a commit to branch master
in repository apache2.

commit 37c6a13032d17ebe51e22932e542d637c54394c5
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Thu Aug 11 14:48:23 2016 +0200

    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.
---
 debian/changelog                            |  3 +++
 debian/debhelper/apache2-maintscript-helper | 24 +++++++++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d9d2f4f..5cf71df 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 at 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 91c3489..58ae4e0 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apache2.git



More information about the Pkg-apache-commits mailing list