summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-01-21 10:36:36 -0500
committerLars Wendler <polynomial-c@gentoo.org>2016-03-03 13:46:26 +0100
commit4634757c03b8b257f809fade3311bd5b8e57af92 (patch)
tree91fcd634ea867b4206b06cbb563c3f9c922a838b
parentapache2.initd: do not call checkconfd() before stopping. (diff)
downloadapache-4634757c03b8b257f809fade3311bd5b8e57af92.tar.gz
apache-4634757c03b8b257f809fade3311bd5b8e57af92.tar.bz2
apache-4634757c03b8b257f809fade3311bd5b8e57af92.zip
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
-rwxr-xr-x2.4/init/apache2.initd9
1 files 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