Created attachment 498822 [details] Proposed fix to apache2ctl enabling described behavior www-servers/apache currently compiles Defines to apache2 daemon command line from variables defined in /etc/conf.d/apache2. These Define-statements are then used in the actual Apache configuration to parse certain directives in configuration within IfDefine - directives. Both OpenRC script and apache2ctl currently lack functionality to enable users to run Apache2 commands with the complete compiled command line, with parameters parsed from the Gentoo specific configuration files. If the commands are run without the compiled CLI, results are affected by that hence being incorrect. I propose adding functionality to apache2ctl - wrapper, which currently is only a wrapper for OpenRC script at /etc/init.d/apache2. This issue has a functional example of this behavior attached. What the modification does, is it looks in to the parameters passed to apache2ctl and if the first parameter is a verb used by /etc/init.d/apache2 it resumes the old behavior - passing the command forward to the init script. In other cases, it uses the same functionality as init script to compile the CLI parameters, and uses the compiled command line to run the command.
For context see this certbot bug, as cert renewals are currently broken (certbot-0.20.0 & apache-2.4.29-r1) https://github.com/certbot/certbot/issues/5344
I had the same problem as described at https://github.com/certbot/certbot/issues/5344 I can confirm that replacing the default apache2ctl with Joona's version makes certbot 0.20.0 great again. app-crypt/certbot-0.20.0::gentoo www-servers/apache-2.4.27-r1::gentoo
So the script points to /bin/sh but uses a couple of bashisms[1]. That won't work with lightweight shells like dash or mksh. This needs to be reworked in order to become POSIX sh compliant before I can put it into a release. [1] https://wiki.ubuntu.com/DashAsBinSh https://mywiki.wooledge.org/Bashism
Same problem here. Would be great if this could be fixed. Thank you!
Created attachment 520254 [details] Proposed fix w/o bashisms Attached is my attempt to remove bashisms per Polynomial-C's request. I tested with both bash and dash.
(In reply to Andrey Falko from comment #5) > Created attachment 520254 [details] > Proposed fix w/o bashisms > > Attached is my attempt to remove bashisms per Polynomial-C's request. I > tested with both bash and dash. You cannot hard-code /usr/lib64 in the script. What about 32bit systems?
Ah well, we can modify it in the ebuild anyway. I gonna hack something up...
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8aed55978b5cd3375bc32f32792e3512862a3b94 commit 8aed55978b5cd3375bc32f32792e3512862a3b94 Author: Lars Wendler <polynomial-c@gentoo.org> AuthorDate: 2018-03-15 10:59:02 +0000 Commit: Lars Wendler <polynomial-c@gentoo.org> CommitDate: 2018-03-15 11:00:19 +0000 www-servers/apache: Bump to version 2.4.32 Changes/Enhancements: - Enabled http2 by default (#563452) - Pass commands to apache with apache2ctl (#634414) Bug: https://bugs.gentoo.org/563452 Closes: https://bugs.gentoo.org/634414 Package-Manager: Portage-2.3.24, Repoman-2.3.6 www-servers/apache/Manifest | 2 + www-servers/apache/apache-2.4.32.ebuild | 248 ++++++++++++++++++++++++++++++++ 2 files changed, 250 insertions(+)