This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rgmanager: master - rgmanager: Allow exit while waiting for fencing


Gitweb:        http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=f2f475ccdf38752ea8f137d1c9b7ff149d22c3bd
Commit:        f2f475ccdf38752ea8f137d1c9b7ff149d22c3bd
Parent:        1a1c7302d985a0f76ae702ce98f36ad7a10c2b7a
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Thu Jun 25 15:27:52 2009 -0400
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Fri Jun 26 14:27:03 2009 -0400

rgmanager: Allow exit while waiting for fencing

Resolves: 508147

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 rgmanager/src/daemons/main.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index 8f9fc2f..88970f1 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -853,20 +853,25 @@ cman_connect(cman_handle_t *ch)
 }
 
 
-static void
+static int
 wait_for_fencing(void)
 {
         if (node_has_fencing(my_id()) && !fence_domain_joined()) {
 		logt_print(LOG_INFO, "Waiting for fence domain join operation "
 		       "to complete\n");
 
-		while (fence_domain_joined() == 0)
+		while (fence_domain_joined() == 0) {
+			if (shutdown_pending)
+				return 1;
 			sleep(1);
+		}
 		logt_print(LOG_INFO, "Fence domain joined\n");
 	} else {
 		logt_print(LOG_DEBUG, "Fence domain already joined "
 		       "or no fencing configured\n");
 	}
+
+	return 0;
 }
 
 
@@ -963,7 +968,8 @@ main(int argc, char **argv)
 
 	logt_print(LOG_INFO, "I am node #%d\n", my_id());
 
-	wait_for_fencing();
+	if (wait_for_fencing() != 0)
+		goto out;
 
 	/*
 	   We know we're quorate.  At this point, we need to
@@ -977,6 +983,9 @@ main(int argc, char **argv)
 		return -1;
 	}
 
+	if (shutdown_pending)
+		goto out;
+
 	if (msg_listen(MSG_SOCKET, RGMGR_SOCK, me.cn_nodeid, &local_ctx) < 0) {
 		logt_print(LOG_CRIT,
 		       "#10: Couldn't set up cluster message system: %s\n",


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]