summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x2.2/init/apache2.initd7
-rwxr-xr-x2.4/init/apache2.initd17
2 files changed, 16 insertions, 8 deletions
diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
index 002e278..e3bc921 100755
--- a/2.2/init/apache2.initd
+++ b/2.2/init/apache2.initd
@@ -78,9 +78,12 @@ start() {
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
local i=0 retval=1
- while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
+ while [ $i -lt ${TIMEOUT} ] ; do
+ if [ -e "${PIDFILE}" ] ; then
+ retval=0
+ break
+ fi
sleep 1 && i=$(expr $i + 1)
- [ -e "${PIDFILE}" ] && retval=0
done
eend ${retval}
diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
index a95e41a..cf3936c 100755
--- a/2.4/init/apache2.initd
+++ b/2.4/init/apache2.initd
@@ -78,12 +78,16 @@ start() {
# Use start stop daemon to apply system limits #347301
start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
- i=0
- while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
+ local i=0 retval=1
+ while [ $i -lt ${TIMEOUT} ] ; do
+ if [ -e "${PIDFILE}" ] ; then
+ retval=0
+ break
+ fi
sleep 1 && i=$(expr $i + 1)
done
- eend $(test $i -lt ${TIMEOUT})
+ eend ${retval}
}
stop() {
@@ -102,13 +106,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() {