Bug 195790 - www/mod_perl2: Leave httpd.conf unmolested when installing / uninstalling / upgrading mod_perl2
Summary: www/mod_perl2: Leave httpd.conf unmolested when installing / uninstalling / u...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-07 23:57 UTC by Terry Kennedy
Modified: 2015-06-14 13:11 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (apache)


Attachments
Log showing the problem (2.43 KB, text/plain)
2014-12-07 23:57 UTC, Terry Kennedy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terry Kennedy 2014-12-07 23:57:27 UTC
Created attachment 150327 [details]
Log showing the problem

When portupgrade installs a new version of this port, the "LoadModule perl_module" in /usr/local/etc/apache*/httpd.conf is unconditionally replaced with a commented-out version. This can causes subsequent reloads/restarts of Apache to fail due to other Perl directives in the Apache configuration file, or (worse) to reload/restart without warning but produce a broken server due to the lack of mod_perl.

This is particularly tricky because "/usr/local/etc/rc.d/apache22 configtest" will NOT detect the second of these conditions.

There is some partial handling of this issue in mod_perl2's pkg_plist, which removes the LoadModule directive but then says "Don't forget to remove all mod_perl2-related directives in your httpd.conf".

It would be better to leave httpd.conf alone and just tell the user to remove the LoadModule and other mod_perl2 directives manually. Hopefully the TestConfig* pieces of the package (upstream) that modify httpd.conf to insert the LoadModule line will leave httpd.conf alone if the line is already present. If not, we may need patches for that as well.
Comment 1 Bugzilla Automation freebsd_committer 2014-12-07 23:57:27 UTC
Auto-assigned to maintainer apache@FreeBSD.org
Comment 2 Matt Simerson 2015-02-03 20:38:32 UTC
> This can causes subsequent reloads/restarts of Apache to fail

I would add that can is too gentle. It *does* break Apache when a mod_perl app tries to load.
Comment 3 Mark Felder freebsd_committer 2015-02-03 20:50:17 UTC
(In reply to matt from comment #2)

I thought I posted a PR about this a while ago as well, but apparently not?

This definitely breaks www/rt42 and was a major source of upgrade pain. Every time packages were updated we had to be careful if mod_perl2 was touched so we could fix httpd.conf before restarting services.

Very annoying.
Comment 4 Terry Kennedy 2015-02-23 12:37:36 UTC
This bug report has been sitting here for 2.5 months without updates from the port maintainer(s). "make maintainer" in the port directory just returns the same "apache@FreeBSD.org" alias address that this port was already assigned to.

Does anyone have any ideas about how to obtain some forward motion on this bug?
Comment 5 Chris Hutchinson 2015-02-23 17:21:47 UTC
(In reply to terry from comment #4)
> This bug report has been sitting here for 2.5 months without updates from
> the port maintainer(s). "make maintainer" in the port directory just returns
> the same "apache@FreeBSD.org" alias address that this port was already
> assigned to.
> 
> Does anyone have any ideas about how to obtain some forward motion on this
> bug?

The only "sure fire" way I can imagine, that would provide
your desired (required?) outcome. Would be to adopt the
port, and make it install in the fashion you find most
suitable.
If you do decide to adopt it, you might do well to post
an RFC on apache@, ports@, and port-bugs@. To indicate your
intentions, and solicit feedback.

Just a thought.

--Chris
Comment 6 Olli Hauer freebsd_committer 2015-02-23 19:49:20 UTC
There is already a way.

# cd etc/apache2x
# grep mod_perl httpd.conf | tr -d '#' >> modules.d/999_mymodules.conf

In modules.d there is a README_modules.d (do not place your config in the README file as it will be overwritten each time by an upgrade)
Comment 7 Olli Hauer freebsd_committer 2015-06-14 13:11:31 UTC
mod_perl installs now a module load file.