From b627844f3d5c5788bd8bb140d8852ba666da16aa Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Tue, 7 Oct 2014 17:49:10 +0200
Subject: [PATCH] init: Don't wait for ipc if corosync doesn't start
Init script now checks return code of executing corosync command. If it
fails, ipc_wait section is skipped, resulting in much faster failure of
init script.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
init/corosync.in | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/init/corosync.in b/init/corosync.in
index 9b9c66f..c93f971 100755
--- a/init/corosync.in
+++ b/init/corosync.in
@@ -115,12 +115,13 @@ start()
else
$prog $COROSYNC_OPTIONS > /dev/null 2>&1
- if ! wait_for_ipc; then
+ if [ "$?" != 0 ] || ! wait_for_ipc; then
failure
rtrn=1
+ else
+ touch $LOCK_FILE
+ success
fi
- touch $LOCK_FILE
- success
fi
echo
}
--
1.7.1