commit c47e5aac1fe63759541e0829c6a2b0d1daa70699
Author: Jim Meyering <meyering(a)redhat.com>
Date: Wed Jun 1 21:35:02 2011 +0200
init-script: make init script "start" fail when mongod doesn't start
* iwhd.init.in (start): Fail (don't just print FAIL) when we time-out
while waiting for mongod to start. Reported by Chris Lalancette in
http://bugzilla.redhat.com/709817.
* NEWS (Bug fixes): Mention this.
NEWS | 6 ++++++
iwhd.init.in | 3 ++-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index a0b33e5..650f95d 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ iwhd NEWS -*- outline
-*-
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ the iwhd init script start function would mistakenly succeed even when
+ mongod failed to start in time. Now, when mongod fails to start, that
+ "start" function also fails.
+
* Noteworthy changes in release 0.95 (2011-05-17) [stable]
diff --git a/iwhd.init.in b/iwhd.init.in
index 59d4032..47f9ceb 100644
--- a/iwhd.init.in
+++ b/iwhd.init.in
@@ -73,7 +73,8 @@ start() {
mkdir -p @localstatedir@/cache/iwhd
rm -rf @localstatedir@/cache/iwhd/*
printf %s $"waiting for mongod to listen on $MONGOD_SERVER_SPEC"
- wait_for_mongod $MONGOD_N_SECONDS && echo_success || echo_failure
+ wait_for_mongod $MONGOD_N_SECONDS && echo_success \
+ || { echo_failure; echo; return 1; }
echo
printf %s $"Starting $SERVICE daemon: "