public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - cman init: fix cman startup issues
@ 2009-08-20 7:35 Fabio M. Di Nitto
0 siblings, 0 replies; only message in thread
From: Fabio M. Di Nitto @ 2009-08-20 7:35 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6c4b0ee0886d6105fe8e5ead2db4e192cbc9e20e
Commit: 6c4b0ee0886d6105fe8e5ead2db4e192cbc9e20e
Parent: cd7204afe474d03067e18f7d6786410893620e07
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Thu Aug 20 09:31:53 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Thu Aug 20 09:31:53 2009 +0200
cman init: fix cman startup issues
with recent changes to cman/corosync to better report errors
on startup, we accidentally fixed "too much" logging with debug="on".
those changes introduced a bunch of problems with file descriptors
in the init script.
change the init script to startup cman in such a way that it
won't make a mess of fd's.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
cman/init.d/cman.in | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index e753f7c..050bfe7 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -169,7 +169,7 @@ ok() {
}
nok() {
- echo $errmsg
+ echo "$errmsg"
failure
echo
exit 1
@@ -479,10 +479,30 @@ set_networking_params()
start_cman()
{
- if ! cman_running && cman_checkconfig; then
- errmsg=$( cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
- $cman_join_opts 2>&1 ) || return 1
+ cman_running && return 0
+ cman_checkconfig || return 1
+
+ tmpfile=$(mktemp -t cmanstartup.XXXXXXXXXX)
+ if [ -z "$tmpfile" ]; then
+ errmsg="Unable to create temporary file"
+ return 1
+ fi
+
+ cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join $cman_join_opts > $tmpfile 2>&1 &
+
+ while status cman_tool >/dev/null 2>&1; do
+ sleep 0.2
+ done
+
+ if ! cman_running; then
+ errmsg="$(cat $tmpfile)"
+ ret=1
+ else
+ ret=0
fi
+
+ rm -f $tmpfile
+ return $ret
}
wait_for_quorum()
@@ -840,7 +860,7 @@ status)
echo "cluster is running."
fi
else
- echo $errmsg
+ echo "$errmsg"
rtrn=1
fi
;;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-20 7:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20 7:35 cluster: STABLE3 - cman init: fix cman startup issues Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).