public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Christine Caulfield <chrissie@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - cman: Improve cman_tool startup error reporting Date: Wed, 22 Jul 2009 15:07:00 -0000 [thread overview] Message-ID: <20090722150651.274071201FC@lists.fedorahosted.org> (raw) 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++; }
reply other threads:[~2009-07-22 15:07 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090722150651.274071201FC@lists.fedorahosted.org \ --to=chrissie@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).