This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - cman: make 'cman_tool leave -w' wait until cman hasshut down
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Fri, 2 Jan 2009 11:10:17 +0000 (UTC)
- Subject: cluster: master - cman: make 'cman_tool leave -w' wait until cman hasshut down
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=59855af76c7022af96b8f89e8d3057768942936b
Commit: 59855af76c7022af96b8f89e8d3057768942936b
Parent: 08b52461b25f45cf6b7bfa4f9a0f1cca32943be6
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:08:14 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)