Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/apache:master commit in: 2.4/init/
Date: Thu, 03 Mar 2016 13:03:32
Message-Id: 1457009186.d78bf0381f86d80fd06ca7f0818003afc09c26ec.polynomial-c@gentoo
1 commit: d78bf0381f86d80fd06ca7f0818003afc09c26ec
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 21 15:16:40 2016 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 3 12:46:26 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=d78bf038
7
8 apache2.initd: apply default values for conf.d variables in one place.
9
10 There are a few variables in the apache2 conf.d file that have default
11 values. The default values were applied at various places in different
12 commands, and often more than once. Since none of those variables need
13 to be modified after the script has loaded, it makes more sense to set
14 them once at the beginning of the script.
15
16 2.4/init/apache2.initd | 15 +++++++--------
17 1 file changed, 7 insertions(+), 8 deletions(-)
18
19 diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
20 index 0a1e6a0..50b6500 100755
21 --- a/2.4/init/apache2.initd
22 +++ b/2.4/init/apache2.initd
23 @@ -15,6 +15,13 @@ description_reload="Kills all children and reloads the configuration."
24 description_virtualhosts="Show the settings as parsed from the config file (currently only shows the virtualhost settings)."
25 description_stop="Kills all children and stops the server."
26
27 +# Apply default values for some conf.d variables.
28 +PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
29 +TIMEOUT=${TIMEOUT:-15}
30 +SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
31 +CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
32 +RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
33 +
34 depend() {
35 need net
36 use mysql dns logger netmount postgresql
37 @@ -28,17 +35,11 @@ configtest() {
38 }
39
40 checkconfd() {
41 - PIDFILE="${PIDFILE:-/var/run/apache2.pid}"
42 - TIMEOUT=${TIMEOUT:-15}
43 -
44 - SERVERROOT="${SERVERROOT:-/usr/lib/apache2}"
45 if [ ! -d ${SERVERROOT} ]; then
46 eerror "SERVERROOT does not exist: ${SERVERROOT}"
47 return 1
48 fi
49
50 - CONFIGFILE="${CONFIGFILE:-/etc/apache2/httpd.conf}"
51 -
52 APACHE2_OPTS="${APACHE2_OPTS} -d ${SERVERROOT}"
53 APACHE2_OPTS="${APACHE2_OPTS} -f ${CONFIGFILE}"
54 [ -n "${STARTUPERRORLOG}" ] && APACHE2_OPTS="${APACHE2_OPTS} -E ${STARTUPERRORLOG}"
55 @@ -106,8 +107,6 @@ stop() {
56 }
57
58 reload() {
59 - RELOAD_TYPE="${RELOAD_TYPE:-graceful}"
60 -
61 checkconfig || return 1
62
63 if [ "${RELOAD_TYPE}" = "restart" ]; then