public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE2 - cman: make 'cman_tool leave -w' wait until cman has shut down
@ 2009-01-02 11:13 Christine Caulfield
0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-01-02 11:13 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=da8be36733c9947828f9a6ff05a65fef0e1af1a0
Commit: da8be36733c9947828f9a6ff05a65fef0e1af1a0
Parent: 8b11305f9314ea3961d28d837a10ff3f0bd46dd9
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:12:27 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 f48c0f6..f4bd81d 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -557,8 +557,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:13 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:13 cluster: STABLE2 - 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).