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.2/init/
Date: Sat, 09 Nov 2013 11:41:09
Message-Id: 1383997184.e606bdae457d39634d3d03f780cbc091dfacbdbd.polynomial-c@gentoo
1 commit: e606bdae457d39634d3d03f780cbc091dfacbdbd
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 9 11:39:44 2013 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 9 11:39:44 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=e606bdae
7
8 apache2.initd: Init script now returns as failed when apache faisl to start.
9
10 ---
11 2.2/init/apache2.initd | 12 +++++++-----
12 1 file changed, 7 insertions(+), 5 deletions(-)
13
14 diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
15 index 249d3de..8cbb030 100755
16 --- a/2.2/init/apache2.initd
17 +++ b/2.2/init/apache2.initd
18 @@ -77,12 +77,13 @@ start() {
19 # Use start stop daemon to apply system limits #347301
20 start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
21
22 - i=0
23 + local i=0 retval=1
24 while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
25 sleep 1 && i=$(expr $i + 1)
26 + [ -e "${PIDFILE}" ] && retval=0
27 done
28
29 - eend $(test $i -lt ${TIMEOUT})
30 + eend ${retval}
31 }
32
33 stop() {
34 @@ -101,13 +102,14 @@ stop() {
35 ebegin "Stopping ${SVCNAME}"
36 ${APACHE2} ${APACHE2_OPTS} -k stop
37
38 - i=0
39 - while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
40 + local i=0 retval=0
41 + while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
42 && [ $i -lt ${TIMEOUT} ]; do
43 sleep 1 && i=$(expr $i + 1)
44 done
45 + [ -e "${PIDFILE}" ] && retval=1
46
47 - eend $(test $i -lt ${TIMEOUT})
48 + eend ${retval}
49 }
50
51 reload() {