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/, 2.4/init/
Date: Fri, 22 Nov 2013 08:48:38
Message-Id: 1385110104.42b9eef61847a4a815c5c3d9adb3030e1d3402b9.polynomial-c@gentoo
1 commit: 42b9eef61847a4a815c5c3d9adb3030e1d3402b9
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 22 08:48:24 2013 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 22 08:48:24 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=42b9eef6
7
8 Fixed startup of init scripts
9
10 ---
11 2.2/init/apache2.initd | 7 +++++--
12 2.4/init/apache2.initd | 17 +++++++++++------
13 2 files changed, 16 insertions(+), 8 deletions(-)
14
15 diff --git a/2.2/init/apache2.initd b/2.2/init/apache2.initd
16 index 002e278..e3bc921 100755
17 --- a/2.2/init/apache2.initd
18 +++ b/2.2/init/apache2.initd
19 @@ -78,9 +78,12 @@ start() {
20 start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
21
22 local i=0 retval=1
23 - while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
24 + while [ $i -lt ${TIMEOUT} ] ; do
25 + if [ -e "${PIDFILE}" ] ; then
26 + retval=0
27 + break
28 + fi
29 sleep 1 && i=$(expr $i + 1)
30 - [ -e "${PIDFILE}" ] && retval=0
31 done
32
33 eend ${retval}
34
35 diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd
36 index a95e41a..cf3936c 100755
37 --- a/2.4/init/apache2.initd
38 +++ b/2.4/init/apache2.initd
39 @@ -78,12 +78,16 @@ start() {
40 # Use start stop daemon to apply system limits #347301
41 start-stop-daemon --start -- ${APACHE2} ${APACHE2_OPTS} -k start
42
43 - i=0
44 - while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
45 + local i=0 retval=1
46 + while [ $i -lt ${TIMEOUT} ] ; do
47 + if [ -e "${PIDFILE}" ] ; then
48 + retval=0
49 + break
50 + fi
51 sleep 1 && i=$(expr $i + 1)
52 done
53
54 - eend $(test $i -lt ${TIMEOUT})
55 + eend ${retval}
56 }
57
58 stop() {
59 @@ -102,13 +106,14 @@ stop() {
60 ebegin "Stopping ${SVCNAME}"
61 ${APACHE2} ${APACHE2_OPTS} -k stop
62
63 - i=0
64 - while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
65 + local i=0 retval=0
66 + while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) \
67 && [ $i -lt ${TIMEOUT} ]; do
68 sleep 1 && i=$(expr $i + 1)
69 done
70 + [ -e "${PIDFILE}" ] && retval=1
71
72 - eend $(test $i -lt ${TIMEOUT})
73 + eend ${retval}
74 }
75
76 reload() {