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