diff options
author | 2008-03-22 15:33:23 +0000 | |
---|---|---|
committer | 2008-03-22 15:33:23 +0000 | |
commit | 24b98cc4e169e665aebb7d8737843fc800ba2cfc (patch) | |
tree | 387c49749c7f81146135b1c883471a423e224ae2 /2.2 | |
parent | fix vhost log format (diff) | |
download | apache-24b98cc4e169e665aebb7d8737843fc800ba2cfc.tar.gz apache-24b98cc4e169e665aebb7d8737843fc800ba2cfc.tar.bz2 apache-24b98cc4e169e665aebb7d8737843fc800ba2cfc.zip |
fix #110556, #209095, #212837
Diffstat (limited to '2.2')
-rw-r--r-- | 2.2/conf/modules.d/00_mpm.conf | 2 | ||||
-rw-r--r-- | 2.2/init/apache2.confd | 6 | ||||
-rwxr-xr-x | 2.2/init/apache2.initd | 29 |
3 files changed, 33 insertions, 4 deletions
diff --git a/2.2/conf/modules.d/00_mpm.conf b/2.2/conf/modules.d/00_mpm.conf index 0183305..3ac621a 100644 --- a/2.2/conf/modules.d/00_mpm.conf +++ b/2.2/conf/modules.d/00_mpm.conf @@ -3,7 +3,7 @@ # PidFile: The file in which the server should record its process # identification number when it starts. # -# Note that this is the default PidFile for most MPMs. +# DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING PidFile /var/run/apache2.pid # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. diff --git a/2.2/init/apache2.confd b/2.2/init/apache2.confd index dbe5a6e..c3cb9fd 100644 --- a/2.2/init/apache2.confd +++ b/2.2/init/apache2.confd @@ -40,6 +40,12 @@ APACHE2_OPTS="-D DEFAULT_VHOST -D LANGUAGE -D INFO" # via them will result in Apache failing to start # YOU HAVE BEEN WARNED. +# PID file +#PIDFILE=/var/run/apache2.pid + +# timeout for startup/shutdown checks +#TIMEOUT=10 + # ServerRoot setting #SERVERROOT=/usr/lib/apache2 diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd index 2a1f839..b3dd8d5 100755 --- a/2.2/init/apache2.initd +++ b/2.2/init/apache2.initd @@ -17,6 +17,9 @@ configtest() { } checkconfd() { + PIDFILE="${PIDFILE:-/var/run/apache2.pid}" + TIMEOUT=${TIMEOUT:-10} + SERVERROOT="${SERVERROOT:-/usr/lib/apache2}" if [ ! -d ${SERVERROOT} ]; then eerror "SERVERROOT does not exist: ${SERVERROOT}" @@ -52,17 +55,33 @@ checkconfig() { start() { checkconfig || return 1 - ebegin "Starting apache2" + [ -f /var/log/apache2/ssl_scache ] && rm /var/log/apache2/ssl_scache + ebegin "Starting apache2" ${APACHE2} ${APACHE2_OPTS} -k start + + let i=0 + while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do + sleep 1 && let i++ + done + + test $i -le ${TIMEOUT} eend $? } stop() { checkconfd || return 1 + ebegin "Stopping apache2" ${APACHE2} ${APACHE2_OPTS} -k stop + + let i=0 + while pidof "${APACHE2}" >/dev/null && [ $i -lt ${TIMEOUT} ]; do + sleep 1 && let i++ + done + + test $i -le ${TIMEOUT} eend $? } @@ -102,7 +121,7 @@ gracefulstop() { fi ebegin "Gracefully stopping apache2" - ${APACHE2} ${APACHE2_OPTS} -k gracefulstop + ${APACHE2} ${APACHE2_OPTS} -k graceful-stop eend $? } @@ -116,9 +135,13 @@ fullstatus() { LYNX="${LYNX:-lynx -dump}" STATUSURL="${STATUSURL:-http://localhost/server-status}" - if ! type -p ${LYNX} 2>&1 >/dev/null; then + if ! service_started "${SVCNAME}"; then + eerror "${SVCNAME} not started" + elif ! type -p ${LYNX} 2>&1 >/dev/null; then eerror "lynx not found! you need to emerge www-client/lynx" else ${LYNX} ${STATUSURL} fi } + +# vim: ts=4 filetype=gentoo-init-d |