-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-6677) make sure event mpm is disabled #1767
Conversation
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 puppetlabs#1766
$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': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this basically equivalent to a file
with ensure => absent
or does a2dismod do more than that? In that case you could even generalize it to if $mpm != 'event'
instead of the OS checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed it did something else but it looks like all it does is remove the symlink in mods-enabled.
I'm hesitant to generalize the conditional only because caution. However, I can't think of a situation where you wouldn't want to have event disabled if it wasn't the selected mpm. Further, maybe there should be logic to exclude any mpm that's not the selected one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further, maybe there should be logic to exclude any mpm that's not the selected one.
Heading to directory purging here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's basically symlink management.
The a2*mod
commands actually were previously used by the apache module via the a2mod
type (it's still there, deprecated and never removed; see https://github.com/puppetlabs/puppetlabs-apache/blob/3.0.0/lib/puppet/type/a2mod.rb). We tried writing providers to give similar functionality on several OSs, but it was very difficult to track all of the different changes across many OSs and each OS version.
The apache module was probably the first to specifically deviate from replicating OS defaults (RedHat-like on redhats and Debian-like on debian) and instead go for a one-size-fits-all. We did keep the mod symlink style via apache::mod
but relied on recursive purging to keep everything inline inside the conf directory. This was 0.7.0 iirc.
What specifically causes the mpm module .load files to clash and not be purged? Is it a dependency between the mods and the file purging? Why do we have to exec out to a2*mod
at all?
Just hit this bug with Ubuntu 17.10, will give your PR a try |
Is there a simple |
@mpdude I guess |
👍 Works for me on Ubuntu 17.10. |
8b13f57
to
654a496
Compare
ran into some hard-to-get-around duplicate declarations when trying to use file resource, so I reverted back to the execs. |
If apache > 2.4 and prefork (required for php in my case) then Package[$packagename] is not installed resulting in error : |
Is there anything I can do to help this getting merged? Update: Just gave Ubuntu 18.04 a try and this PR does not seem to do the trick. |
Is there anything i can do, to help getting this or this: #1766 merged? |
This doesn't include a condition for 'prefork' on Ubuntu 18.04... could this be included after line 75:
|
@mpdude @cmseal @maxdelorme i have reworked #1766 you can have a look at. |
Closing due to #1766 being merged. Thank you everyone for your work and input! |
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