All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2007-02-19 13:10 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2007-02-19 13:10 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-02-19 13:10:25

Modified files:
	cman/cman_tool : join.c 

Log message:
	If exec fails, then tell the parent process.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&r1=1.49&r2=1.50

--- cluster/cman/cman_tool/join.c	2007/02/14 09:37:52	1.49
+++ cluster/cman/cman_tool/join.c	2007/02/19 13:10:24	1.50
@@ -139,7 +139,11 @@
 		be_daemon(!comline->verbose);
 		chdir(SBINDIR);
 		execve("./aisexec", argv, envp);
-		die("execve of " SBINDIR "/aisexec failed: %s", strerror(errno));
+
+		// exec failed - tell the parent process */
+		sprintf(scratch, "execve of " SBINDIR "/aisexec failed: %s", strerror(errno));
+		write(p[1], scratch, strlen(scratch));
+		exit(1);
 		break;
 
 	default: //parent



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2008-01-30 16:06 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2008-01-30 16:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-01-30 16:06:07

Modified files:
	cman/cman_tool : join.c 

Log message:
	Oops. a bit too much cman3 fell into that last checkin

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&r1=1.54&r2=1.55

--- cluster/cman/cman_tool/join.c	2008/01/30 15:46:41	1.54
+++ cluster/cman/cman_tool/join.c	2008/01/30 16:06:07	1.55
@@ -121,12 +121,11 @@
 	}
 	if (comline->noccs_opt) {
 		envp[envptr++] = strdup("CMAN_NOCCS=true");
-		envp[envptr++] = strdup("OPENAIS_DEFAULT_CONFIG_IFACE=cmanpreconfig");
-	}
-	else {
-		envp[envptr++] = strdup("OPENAIS_DEFAULT_CONFIG_IFACE=cmanconfig");
 	}
 
+	/* Use cman to configure services */
+	envp[envptr++] = strdup("OPENAIS_DEFAULT_CONFIG_IFACE=cmanconfig");
+
 	/* Create a pipe to monitor cman startup progress */
 	pipe(p);
 	fcntl(p[1], F_SETFD, 0); /* Don't close on exec */



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2007-02-19 13:14 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2007-02-19 13:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-02-19 13:14:43

Modified files:
	cman/cman_tool : join.c 

Log message:
	If exec fails then tell the parent process.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.47.2.1&r2=1.47.2.2

--- cluster/cman/cman_tool/join.c	2006/12/12 16:51:10	1.47.2.1
+++ cluster/cman/cman_tool/join.c	2007/02/19 13:14:42	1.47.2.2
@@ -139,7 +139,11 @@
 		be_daemon(!comline->verbose);
 		chdir(SBINDIR);
 		execve("./aisexec", argv, envp);
-		die("execve of " SBINDIR "/aisexec failed: %s", strerror(errno));
+
+		// exec failed - tell the parent process */
+		sprintf(scratch, "execve of " SBINDIR "/aisexec failed: %s", strerror(errno));
+		write(p[1], scratch, strlen(scratch));
+		exit(1);
 		break;
 
 	default: //parent
@@ -169,7 +173,7 @@
 			}
 			else {
 				int pidstatus;
-				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0)
+				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0 && pidstatus != 0)
 					fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus));
 				else
 					status = 0; /* Try to connect */



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2007-02-14  9:37 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2007-02-14  9:37 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-02-14 09:37:52

Modified files:
	cman/cman_tool : join.c 

Log message:
	Don't report 0 exit status as a failure.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&r1=1.48&r2=1.49

--- cluster/cman/cman_tool/join.c	2006/12/07 09:54:14	1.48
+++ cluster/cman/cman_tool/join.c	2007/02/14 09:37:52	1.49
@@ -169,7 +169,7 @@
 			}
 			else {
 				int pidstatus;
-				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0)
+				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0 && pidstatus != 0)
 					fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus));
 				else
 					status = 0; /* Try to connect */



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2006-12-12 16:52 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2006-12-12 16:52 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	pcaulfield at sourceware.org	2006-12-12 16:52:14

Modified files:
	cman/cman_tool : join.c 

Log message:
	Fix minor bug where cman_tool join didn't spot that aisexec had started
	correctly or crashed.
	
	This means we can up the timer for allowing aisexec to start with no ill
	effects. see bz#218688

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.47&r2=1.47.4.1

--- cluster/cman/cman_tool/join.c	2006/08/11 12:34:18	1.47
+++ cluster/cman/cman_tool/join.c	2006/12/12 16:52:14	1.47.4.1
@@ -11,6 +11,7 @@
 *******************************************************************************
 ******************************************************************************/
 
+#include <sys/wait.h>
 #include <stdint.h>
 #include <signal.h>
 #include <netinet/in.h>
@@ -148,6 +149,7 @@
 
 	/* Give the daemon a chance to start up, and monitor the pipe FD for messages */
 	i = 0;
+	close(p[1]);
 	do {
 		fd_set fds;
 		struct timeval tv={1, 0};
@@ -158,13 +160,6 @@
 		FD_SET(p[0], &fds);
 
 		status = select(p[0]+1, &fds, NULL, NULL, &tv);
-		if (status == 0) {
-			h = cman_admin_init(NULL);
-			if (!h && comline->verbose)
-			{
-				fprintf(stderr, "waiting for aisexec to start\n");
-			}
-		}
 
 		/* Did we get an error? */
 		if (status == 1) {
@@ -172,9 +167,22 @@
 				fprintf(stderr, "cman not started: %s\n", message);
 				break;
 			}
-
+			else {
+				int pidstatus;
+				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0)
+					fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus));
+				else
+					status = 0; /* Try to connect */
+			}
+		}
+		if (status == 0) {
+			h = cman_admin_init(NULL);
+			if (!h && comline->verbose)
+			{
+				fprintf(stderr, "waiting for aisexec to start\n");
+			}
 		}
-	} while (!h && ++i < 20);
+	} while (!h && ++i < 100);
 
 	if (!h)
 		die("aisexec daemon didn't start");



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2006-12-12 16:51 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2006-12-12 16:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2006-12-12 16:51:11

Modified files:
	cman/cman_tool : join.c 

Log message:
	Fix minor bug where cman_tool join didn't spot that aisexec had started
	correctly or crashed.
	
	This means we can up the timer for allowing aisexec to start with no ill
	effects. see bz#218688

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.47&r2=1.47.2.1

--- cluster/cman/cman_tool/join.c	2006/08/11 12:34:18	1.47
+++ cluster/cman/cman_tool/join.c	2006/12/12 16:51:10	1.47.2.1
@@ -11,6 +11,7 @@
 *******************************************************************************
 ******************************************************************************/
 
+#include <sys/wait.h>
 #include <stdint.h>
 #include <signal.h>
 #include <netinet/in.h>
@@ -148,6 +149,7 @@
 
 	/* Give the daemon a chance to start up, and monitor the pipe FD for messages */
 	i = 0;
+	close(p[1]);
 	do {
 		fd_set fds;
 		struct timeval tv={1, 0};
@@ -158,13 +160,6 @@
 		FD_SET(p[0], &fds);
 
 		status = select(p[0]+1, &fds, NULL, NULL, &tv);
-		if (status == 0) {
-			h = cman_admin_init(NULL);
-			if (!h && comline->verbose)
-			{
-				fprintf(stderr, "waiting for aisexec to start\n");
-			}
-		}
 
 		/* Did we get an error? */
 		if (status == 1) {
@@ -172,9 +167,22 @@
 				fprintf(stderr, "cman not started: %s\n", message);
 				break;
 			}
-
+			else {
+				int pidstatus;
+				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0)
+					fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus));
+				else
+					status = 0; /* Try to connect */
+			}
+		}
+		if (status == 0) {
+			h = cman_admin_init(NULL);
+			if (!h && comline->verbose)
+			{
+				fprintf(stderr, "waiting for aisexec to start\n");
+			}
 		}
-	} while (!h && ++i < 20);
+	} while (!h && ++i < 100);
 
 	if (!h)
 		die("aisexec daemon didn't start");



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Cluster-devel] cluster/cman/cman_tool join.c
@ 2006-12-07  9:54 pcaulfield
  0 siblings, 0 replies; 7+ messages in thread
From: pcaulfield @ 2006-12-07  9:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-12-07 09:54:15

Modified files:
	cman/cman_tool : join.c 

Log message:
	Fix minor bug where cman_tool join didn't spot that aisexec had started
	correctly or crashed.
	
	This means we can up the timer for allowing aisexec to start with no ill
	effects. see bz#218688

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&r1=1.47&r2=1.48

--- cluster/cman/cman_tool/join.c	2006/08/11 12:34:18	1.47
+++ cluster/cman/cman_tool/join.c	2006/12/07 09:54:14	1.48
@@ -11,6 +11,7 @@
 *******************************************************************************
 ******************************************************************************/
 
+#include <sys/wait.h>
 #include <stdint.h>
 #include <signal.h>
 #include <netinet/in.h>
@@ -148,6 +149,7 @@
 
 	/* Give the daemon a chance to start up, and monitor the pipe FD for messages */
 	i = 0;
+	close(p[1]);
 	do {
 		fd_set fds;
 		struct timeval tv={1, 0};
@@ -158,13 +160,6 @@
 		FD_SET(p[0], &fds);
 
 		status = select(p[0]+1, &fds, NULL, NULL, &tv);
-		if (status == 0) {
-			h = cman_admin_init(NULL);
-			if (!h && comline->verbose)
-			{
-				fprintf(stderr, "waiting for aisexec to start\n");
-			}
-		}
 
 		/* Did we get an error? */
 		if (status == 1) {
@@ -172,9 +167,22 @@
 				fprintf(stderr, "cman not started: %s\n", message);
 				break;
 			}
-
+			else {
+				int pidstatus;
+				if (waitpid(aisexec_pid, &pidstatus, WNOHANG) == 0)
+					fprintf(stderr, "cman died with status: %d\n", WEXITSTATUS(pidstatus));
+				else
+					status = 0; /* Try to connect */
+			}
+		}
+		if (status == 0) {
+			h = cman_admin_init(NULL);
+			if (!h && comline->verbose)
+			{
+				fprintf(stderr, "waiting for aisexec to start\n");
+			}
 		}
-	} while (!h && ++i < 20);
+	} while (!h && ++i < 100);
 
 	if (!h)
 		die("aisexec daemon didn't start");



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-30 16:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 13:10 [Cluster-devel] cluster/cman/cman_tool join.c pcaulfield
  -- strict thread matches above, loose matches on Subject: below --
2008-01-30 16:06 pcaulfield
2007-02-19 13:14 pcaulfield
2007-02-14  9:37 pcaulfield
2006-12-12 16:52 pcaulfield
2006-12-12 16:51 pcaulfield
2006-12-07  9:54 pcaulfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.