From 654a496fbd163a0b33da3b7326e25da781e30e20 Mon Sep 17 00:00:00 2001 From: Eric Putnam Date: Fri, 2 Mar 2018 09:44:36 -0800 Subject: [PATCH] (MODULES-6677) make sure event mpm is disabled Currently, on Debian 9 specifically, the event mod may be enabled when trying to use a different mpm. This ensures event is disabled if another mpm is chosen. Also closes #1766 --- manifests/mpm.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manifests/mpm.pp b/manifests/mpm.pp index bc4b6f974e..5fdee33c0d 100644 --- a/manifests/mpm.pp +++ b/manifests/mpm.pp @@ -79,10 +79,20 @@ $packagename = "apache2-mpm-${mpm}" } + $mod_enabled_dir = $::apache::mod_enable_dir + + if $mpm == 'prefork' and ( $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9.0.0') >= 0 ) { + exec { '/usr/sbin/a2dismod mpm_event': + onlyif => "/usr/bin/test -e ${mod_enabled_dir}/mpm_event.load", + require => Package['httpd'], + before => Package[$packagename], + } + } + if $mpm == 'itk' and ( ( $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease == '14.04' ) or ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9.0.0') >= 0 ) ) { # workaround https://bugs.launchpad.net/ubuntu/+source/mpm-itk/+bug/1286882 exec { '/usr/sbin/a2dismod mpm_event': - onlyif => '/usr/bin/test -e /etc/apache2/mods-enabled/mpm_event.load', + onlyif => "/usr/bin/test -e ${mod_enabled_dir}/mpm_event.load", require => Package['httpd'], before => Package[$packagename], }