summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2016-01-21 10:16:40 -0500
committerLars Wendler <polynomial-c@gentoo.org>2016-03-03 13:46:26 +0100
commitd78bf0381f86d80fd06ca7f0818003afc09c26ec (patch)
tree524b74ca43bb0c16d3ce756260ec8517306c4d41 /2.4/init/apache2.initd
parentapache2.initd: remove config file readability check. (diff)
downloadapache-d78bf0381f86d80fd06ca7f0818003afc09c26ec.tar.gz
apache-d78bf0381f86d80fd06ca7f0818003afc09c26ec.tar.bz2
apache-d78bf0381f86d80fd06ca7f0818003afc09c26ec.zip
apache2.initd: apply default values for conf.d variables in one place.
There are a few variables in the apache2 conf.d file that have default values. The default values were applied at various places in different commands, and often more than once. Since none of those variables need to be modified after the script has loaded, it makes more sense to set them once at the beginning of the script.
Diffstat (limited to '2.4/init/apache2.initd')
-rwxr-xr-x2.4/init/apache2.initd15
1 files changed, 7 insertions, 8 deletions
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
index 0a1e6a0..50b6500 100755
--- a/2.4/init/apache2.initd
+++ b/2.4/init/apache2.initd
@@ -15,6 +15,13 @@ description_reload="Kills all children and reloads the configuration."
description_virtualhosts="Show the settings as parsed from the config file (currently only shows the virtualhost settings)."
description_stop="Kills all children and stops the server."
+# Apply default values for some conf.d variables.
+PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
+TIMEOUT=${TIMEOUT:-15}
+SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
+CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
+RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
+
depend() {
need net
use mysql dns logger netmount postgresql
@@ -28,17 +35,11 @@ configtest() {
}
checkconfd() {
- PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
- TIMEOUT=${TIMEOUT:-15}
-
- SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
if [ ! -d ${SERVERROOT} ]; then
eerror "SERVERROOT does not exist: ${SERVERROOT}"
return 1
fi
- CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
-
APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
[ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
@@ -106,8 +107,6 @@ stop() {
}
reload() {
- RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
-
checkconfig || return 1
if [ "${RELOAD_TYPE}" = "restart" ]; then