-
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
Update load.epp to avoid loading a module already loaded #2483
base: main
Are you sure you want to change the base?
Conversation
avoid loading a module already loaded if default file module are put during Apache upgrade via the scriplet
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.
Can you share which OS + version you ran into this? I'd guess some EL based system since RPM can't deal with removed files (unlike DPKG for Debian), but then it would be useful to know which files. I think it's better to lay out files in a way that they overwrite native file locations instead of removing some file and creating it elsewhere.
templates/mod/load.epp
Outdated
@@ -4,4 +4,6 @@ LoadFile <%= $loadfile %> | |||
<% } -%> | |||
|
|||
<% } -%> | |||
<IfModule <%= $_id %> > |
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.
https://httpd.apache.org/docs/2.4/mod/core.html#ifmodule suggests this is executed if $_id
is present, but shouldn't it be the other way around?
<IfModule <%= $_id %> > | |
<IfModule !<%= $_id %> > |
Fix : Forgot "!"
OS : Oracle Linux 8 => 5.15.0-104.119.4.2.el8uek.x86_64 Examples files put by scriplet : Apache module configure "loadModule" in <module_name>.load ( example "ssl.load"), but apache scriplet set in "00-ssl.conf". "I think it's better to lay out files in a way that they overwrite native file locations instead of removing some file and creating it elsewhere." Of course, i totaly agree, but the modules management is different. It would be necessary to modify the entire module management in Apache puppet module . Scriplet apache can put many "LoadModule" in one file. But Apache module set in different file (proxy_ajp.load,proxy_balancer.load,proxy_connect.load ...) Other one, the file 00-proxyhtml.conf : Apache module set then in xml2enc.load and proxy_html.load |
So that's pretty much what I suspected. I think it's something that we should tackle properly. This now leads to 2 service restarts: once when the package is updated and once when the config is rewritten. At least the second time is downtime that shouldn't be needed. I think an acceptance test that does the follow will catch it:
Another way is to use |
Yes, so the easiest way to avoid this problem is to:
So we avoid restarting Apache service multiple times. If you agree, I can do the patch on my side and reopen a pull request. Tell me if it suits you. |
As a regression test, it would be good to have this in acceptance tests. That makes adding a new OS version (like EL 10) easier.
bf9f0d0 is a historical precedent for this. That time it affected mod_ssl on Red Hat. Anything we missed I'd consider a bug.
I'd like that a lot.
It does suit me. Please do. |
I encountered a problem during an Apache update. The scriplet executed during updates set up the default configuration of module loads. If the node with puppet agent no longer has the puppet configuration active then there is a duplicate problem in the loading of modules, example of warning returned:
[so:warn] [pid 15619] AH01574: module dav_module is already loaded, skipping
The commit therefore makes it possible to load the module if it is not already loaded and thus avoid warnings on duplicates.