FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 05-09-2008, 07:13 AM
 
Default Cluster Project branch, master, updated. cluster-2.99.00-32-g3c3e0dd

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=3c3e0dd3db ca52c6edb5ce86d7de2ab09556e838

The branch, master has been updated
via 3c3e0dd3dbca52c6edb5ce86d7de2ab09556e838 (commit)
from 1324777f47317068a50837a5c1deb50bab3179c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3c3e0dd3dbca52c6edb5ce86d7de2ab09556e838
Author: Christine Caulfield <ccaulfie@redhat.com>
Date: Fri May 9 08:08:51 2008 +0100

[CMAN] fix cman_tool join -X

Even when state with cman_tool -X, the preconfig stage tried to lookup
the node in the objdb (which is empty!) and fails if it was not found.

The "aisexec" object did not exist so the username was not stored.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
cman/daemon/cman-preconfig.c | 88 +++++++++++++++++++++++++-----------------
1 files changed, 53 insertions(+), 35 deletions(-)

diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 7ea925c..2db7eab 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -455,49 +455,51 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
unsigned int alt_object;
int error;

- /* our nodename */
- if (nodename_env != NULL) {
- if (strlen(nodename_env) >= sizeof(nodename)) {
- sprintf(error_reason, "Overridden node name %s is too long", nodename);
- write_cman_pipe("Overridden node name is too long");
- error = -1;
- goto out;
- }
+ if (!getenv("CMAN_NOCONFIG")) {
+ /* our nodename */
+ if (nodename_env != NULL) {
+ if (strlen(nodename_env) >= sizeof(nodename)) {
+ sprintf(error_reason, "Overridden node name %s is too long", nodename);
+ write_cman_pipe("Overridden node name is too long");
+ error = -1;
+ goto out;
+ }

- strcpy(nodename, nodename_env);
+ strcpy(nodename, nodename_env);

- if (objdb->object_find(object_handle,
- nodename, strlen(nodename),
- &node_object_handle) != 0) {
- sprintf(error_reason, "Overridden node name %s is not in CCS", nodename);
- write_cman_pipe("Overridden node name is not in CCS");
- error = -1;
- goto out;
- }
+ if (objdb->object_find(object_handle,
+ nodename, strlen(nodename),
+ &node_object_handle) != 0) {
+ sprintf(error_reason, "Overridden node name %s is not in CCS", nodename);
+ write_cman_pipe("Overridden node name is not in CCS");
+ error = -1;
+ goto out;
+ }

- } else {
- struct utsname utsname;
+ } else {
+ struct utsname utsname;

- error = uname(&utsname);
- if (error) {
- sprintf(error_reason, "cannot get node name, uname failed");
- write_cman_pipe("Can't determine local node name");
- error = -1;
- goto out;
- }
+ error = uname(&utsname);
+ if (error) {
+ sprintf(error_reason, "cannot get node name, uname failed");
+ write_cman_pipe("Can't determine local node name");
+ 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");
- 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");
+ error = -1;
+ goto out;
+ }
+
+ strcpy(nodename, utsname.nodename);
}
+ if (verify_nodename(objdb, nodename))
+ return -1;

- strcpy(nodename, utsname.nodename);
}
- if (verify_nodename(objdb, nodename))
- return -1;
-

/* Add <cman nodename> */
if ( (node_object_handle = nodelist_byname(objdb, cluster_parent_handle, nodename))) {
@@ -722,6 +724,12 @@ static void add_cman_overrides(struct objdb_iface_ver0 *objdb)

/* Don't run under user "ais" */
objdb->object_find_reset(OBJECT_PARENT_HANDLE);
+ if (objdb->object_find(OBJECT_PARENT_HANDLE, "aisexec", strlen("aisexec"), &object_handle) != 0) {
+ objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
+ "aisexec", strlen("aisexec"));
+
+ }
+ objdb->object_find_reset(OBJECT_PARENT_HANDLE);
if (objdb->object_find(OBJECT_PARENT_HANDLE, "aisexec", strlen("aisexec"), &object_handle) == 0)
{
objdb->object_key_create(object_handle, "user", strlen("user"),
@@ -940,3 +948,13 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin

return ret;
}
+
+/* Write an error message down the CMAN startup pipe so
+ that cman_tool can display it */
+int write_cman_pipe(char *message)
+{
+ if (startup_pipe)
+ return write(startup_pipe, message, strlen(message)+1);
+
+ return 0;
+}


hooks/post-receive
--
Cluster Project
 

Thread Tools




All times are GMT. The time now is 07:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org