diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2013-11-09 12:39:44 +0100 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2013-11-09 16:35:07 +0100 |
commit | a6a88dc3addc89f6b665828cb37a35270656023c (patch) | |
tree | fcc686a922c11ee4c0673dd09371c68d181579c7 | |
parent | Update default to better match upstream intentions, thank Steve Dibb for repo... (diff) | |
download | apache-a6a88dc3addc89f6b665828cb37a35270656023c.tar.gz apache-a6a88dc3addc89f6b665828cb37a35270656023c.tar.bz2 apache-a6a88dc3addc89f6b665828cb37a35270656023c.zip |
apache2.initd: Init script now returns as failed when apache fails to start.
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
-rwxr-xr-x | 2.2/init/apache2.initd | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd index 249d3de..8cbb030 100755 --- a/2.2/init/apache2.initd +++ b/2.2/init/apache2.initd @@ -77,12 +77,13 @@ start() { # Use start stop daemon to apply system limits #347301 start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start - i=0 + local i=0 retval=1 while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do sleep 1 && i=$(expr $i + 1) + [ -e "${PIDFILE}" ] && retval=0 done - eend $(test $i -lt ${TIMEOUT}) + eend ${retval} } stop() { @@ -101,13 +102,14 @@ stop() { ebegin "Stopping ${SVCNAME}" ${APACHE2} ${APACHE2_OPTS} -k stop - i=0 - while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \ + local i=0 retval=0 + while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \ && [ $i -lt ${TIMEOUT} ]; do sleep 1 && i=$(expr $i + 1) done + [ -e "${PIDFILE}" ] && retval=1 - eend $(test $i -lt ${TIMEOUT}) + eend ${retval} } reload() { |