commit: 4634757c03b8b257f809fade3311bd5b8e57af92
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 21 15:36:36 2016 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Mar 3 12:46:26 2016 +0000
URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=4634757c
apache2.initd: append STARTUPERRORLOG to APACHE2_OPTS in start().
We currently append the value of STARTUPERRORLOG to APACHE2_OPTS in
the checkconfd() function. This can cause duplication of command-line
arguments as witnessed in bug 566726. Since STARTUPERRORLOG does need
conditional handling (we don't append it if it's empty), the wisest
place to do so seems to be in start().
Gentoo-Bug: 566726
2.4/init/apache2.initd | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
index e493f05..6320f1a 100755
--- a/2.4/init/apache2.initd
+++ b/2.4/init/apache2.initd
@@ -45,8 +45,6 @@ checkconfd() {
APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
- [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E
${STARTUPERRORLOG}"
-
}
checkconfig() {
@@ -66,6 +64,13 @@ checkconfig() {
start() {
checkconfig || return 1
+ if [ -n "${STARTUPERRORLOG}" ] ; then
+ # We must make sure that we only append to APACHE2_OPTS
+ # in start() and not in stop() or anywhere else that may
+ # be executed along with start(), see bug #566726.
+ APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
+ fi
+
ebegin "Starting ${SVCNAME}"
# Use start stop daemon to apply system limits #347301
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start