public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - cman: Improve cman_tool startup error reporting
@ 2009-07-22 15:07 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2009-07-22 15:07 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=09aa3a3c4979b514379c56066d416d01a1e6ac3d
Commit:        09aa3a3c4979b514379c56066d416d01a1e6ac3d
Parent:        43371def0f66c4d026342b2beac015bb4cd2f5c4
Author:        Christine Caulfield <christine@rhdesktop.chrissie.net>
AuthorDate:    Wed Jul 22 16:04:48 2009 +0100
Committer:     Christine Caulfield <christine@rhdesktop.chrissie.net>
CommitterDate: Wed Jul 22 16:04:48 2009 +0100

cman: Improve cman_tool startup error reporting

Several errors that can be generated by cman-preconfig get discarded and
replaced with a rather cursory and unhelpful
"corosync died: Could not read cluster configuration"

Now we print the messages passed back before examining the corosync
exit status.

Signed-off-by: Christine Caulfield <christine@rhdesktop.chrissie.net>
---
 cman/cman_tool/join.c        |    6 +++++-
 cman/daemon/cman-preconfig.c |   16 +++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c
index eaea597..2a0e017 100644
--- a/cman/cman_tool/join.c
+++ b/cman/cman_tool/join.c
@@ -272,7 +272,7 @@ int join(commandline_t *comline, char *main_envp[])
 						fprintf(stderr, "forked process ID is %d\n", corosync_pid);
 					status = 1;
 
-					/* There might be a SUCCESS message in the pipe too. */
+					/* There might be a SUCCESS or error message in the pipe too. */
 					messageptr = strchr(messageptr, '\n');
 					if (messageptr)
 						messageptr++;
@@ -286,6 +286,10 @@ int join(commandline_t *comline, char *main_envp[])
 					status = 0;
 					break;
 				}
+				else if (messageptr) {
+						fprintf(stderr, "%s\n", messageptr);
+						break;
+					}
 			}
 			else if (len < 0 && errno == EINTR) {
 				continue;
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 1dc7a26..8c490df 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -543,22 +543,24 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
 			error = uname(&utsname);
 			if (error) {
 				sprintf(error_reason, "cannot get node name, uname failed");
-				write_cman_pipe("Can't determine local node name");
+				write_cman_pipe("Can't determine local node name, uname failed");
 				error = -1;
 				goto out;
 			}
 
 			if (strlen(utsname.nodename) >= sizeof(nodename)) {
 				sprintf(error_reason, "node name from uname is too long");
-				write_cman_pipe("Can't determine local node name");
+				write_cman_pipe("local node name is too long");
 				error = -1;
 				goto out;
 			}
 
 			strcpy(nodename, utsname.nodename);
 		}
-		if (verify_nodename(objdb, nodename))
+		if (verify_nodename(objdb, nodename)) {
+			write_cman_pipe("Cannot find node name in cluster.conf");
 			return -1;
+		}
 
 	}
 
@@ -622,8 +624,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
 		free(str);
 	}
 
-	if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast))
+	if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast)) {
+		write_cman_pipe(error_reason);
 		return -1;
+	}
 
 	/* Get all alternative node names */
 	num_nodenames = 1;
@@ -643,8 +647,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
 			mcast = mcast_name;
 		}
 
-		if (add_ifaddr(objdb, mcast, node, portnum, broadcast))
+		if (add_ifaddr(objdb, mcast, node, portnum, broadcast)) {
+			write_cman_pipe(error_reason);
 			return -1;
+		}
 
 		num_nodenames++;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-22 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 15:07 cluster: STABLE3 - cman: Improve cman_tool startup error reporting 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).