public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/apache:trunk commit in: 2.2/init/
Date: Sat,  9 Nov 2013 15:39:30 +0000 (UTC)	[thread overview]
Message-ID: <1384011307.a6a88dc3addc89f6b665828cb37a35270656023c.polynomial-c@gentoo> (raw)
Message-ID: <20131109153930.no2OizS4TUpTgsyiaaO7IJ83t4ILh2VXJMLHoc9nptU@z> (raw)

commit:     a6a88dc3addc89f6b665828cb37a35270656023c
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  9 11:39:44 2013 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Nov  9 15:35:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/apache.git;a=commit;h=a6a88dc3

apache2.initd: Init script now returns as failed when apache fails to start.

Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

---
 2.2/init/apache2.initd | 12 +++++++-----
 1 file 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() {


             reply	other threads:[~2013-11-09 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-09 15:36 Lars Wendler [this message]
2013-11-09 15:39 ` [gentoo-commits] proj/apache:trunk commit in: 2.2/init/ Lars Wendler
  -- strict thread matches above, loose matches on Subject: below --
2014-05-14 13:56 [gentoo-commits] proj/apache:master " Lars Wendler
2013-11-09 17:09 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:33 Lars Wendler
2013-11-09 15:32 Lars Wendler
2013-11-09 15:32 Lars Wendler
2013-11-09 11:41 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384011307.a6a88dc3addc89f6b665828cb37a35270656023c.polynomial-c@gentoo \
    --to=polynomial-c@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox