public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - cman: make 'cman_tool leave -w' wait until cman has shut down
@ 2009-01-02 11:12 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-01-02 11:12 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=503dbbdd7d44d537c1787baca4837457c709a2b2
Commit:        503dbbdd7d44d537c1787baca4837457c709a2b2
Parent:        d77c6775ed1be2cf5c4bf75b3930e67b92fc918f
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Fri Jan 2 11:08:14 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Fri Jan 2 11:10:36 2009 +0000

cman: make 'cman_tool leave -w' wait until cman has shut down

Once we get a sucessful return from cman_try_shutdown there still
might be a delay before cman actually shuts down because
the LEAVE messages need to be sent around the ring.

cman_tool now waits until it can no-longer contact cman if -w is
given on the command-line.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/cman_tool/main.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c
index 4c6d667..c48083b 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -564,8 +564,15 @@ static void leave(commandline_t *comline)
 	if (result) {
 		die("Error leaving cluster: %s", cman_error(errno));
 	}
-
 	cman_finish(h);
+
+	/* Wait until cman shuts down */
+	if (comline->wait_opt) {
+		while ( (h = cman_admin_init(NULL)) ) {
+			cman_finish(h);
+			sleep(1);
+		}
+	}
 }
 
 static void set_expected(commandline_t *comline)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-02 11:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-02 11:12 cluster: STABLE3 - cman: make 'cman_tool leave -w' wait until cman has shut down Christine Caulfield

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).