[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/fence/fence_tool fence_tool.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	rohara sourceware org	2007-01-05 16:24:30

Modified files:
	fence/fence_tool: fence_tool.c 

Log message:
	Add timeout option for fence_tool leave.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/fence_tool/fence_tool.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.14&r2=1.5.2.15

--- cluster/fence/fence_tool/fence_tool.c	2006/12/20 18:14:29	1.5.2.14
+++ cluster/fence/fence_tool/fence_tool.c	2007/01/05 16:24:29	1.5.2.15
@@ -62,7 +62,7 @@
 int operation;
 int child_wait;
 int quorum_wait = TRUE;
-int fenced_start_timeout = 0;
+int fenced_timeout = 0;
 int signalled = 0;
 int cl_sock;
 char our_name[MAX_CLUSTER_MEMBER_NAME_LEN+1];
@@ -282,9 +282,9 @@
 
 	setup_sock();
 
-       	if (fenced_start_timeout) {
+       	if (fenced_timeout) {
                	signal(SIGALRM, sigalarm_handler);
-               	alarm(fenced_start_timeout);
+               	alarm(fenced_timeout);
        	}
 
 	if (!check_quorum()) {
@@ -373,6 +373,18 @@
 	check_mounted();
 	setup_sock();
 
+	if (fenced_timeout) {
+               	signal(SIGALRM, sigalarm_handler);
+               	alarm(fenced_timeout);
+       	}
+
+	if (!check_quorum()) {
+		if (errno == ETIMEDOUT)
+			printf("%s: Timed out waiting for cluster "
+			       "quorum to form.\n", prog_name);
+		return EXIT_FAILURE;
+	}
+
 	if (!check_quorum())
 		return EXIT_FAILURE;
 
@@ -490,7 +502,7 @@
 			break;
 
                 case 't':
-                        fenced_start_timeout = get_int_arg(optchar, optarg);
+                        fenced_timeout = get_int_arg(optchar, optarg);
                         break;
 
 		case 'c':


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]