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".
The branch, master has been updated
via 4e449d4110b416a7c1da8eb2cca3e81338085db5 (commit)
from f0cc81be7ea17b3d53916c150bb8d4231511b2fa (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.
[CMAN] Remove external dependancies from config modules
This remove the external depandancies from the aisexec config
modules because they break all sorts of things.
Instead of logging errors, they return them back to the caller - this removes
the dependancy on logsys.
Also, I've remove the totemip function calls and replaced them with
usable subsets in the config code itself.
The cman and ccs config plugins now work with testconfdb in
standalone mode.
- /* Initialise early logging */
- if (getenv("CCS_DEBUGLOG"))
- debug_mask = atoi(getenv("CCS_DEBUGLOG"));
-
- set_debuglog(debug_mask);
-
/* We need to set this up to internal defaults too early */
openlog("openais", LOG_CONS|LOG_PID, LOG_LOCAL4);
- /* Enable stderr logging if requested by cman_tool */
- if (debug_mask) {
- logsys_config_subsys_set("CCS", LOGSYS_TAG_LOG, LOG_DEBUG);
- }
-
/* Read low-level totem/aisexec etc config from CCS */
if ( !(ret = init_config(objdb, error_reason)) )
sprintf (error_reason, "%s", "Successfully read config from CCS
");
@@ -233,7 +217,6 @@ static int init_config(struct objdb_iface_ver0 *objdb, char *error_string)
/* Connect to ccsd */
if (getenv("CCS_CLUSTER_NAME")) {
cname = getenv("CCS_CLUSTER_NAME");
- log_printf(LOG_INFO, "Using override cluster name %s
", cname);
}
/* optional port */
if (getenv("CMAN_IP_PORT")) {
portnum = atoi(getenv("CMAN_IP_PORT"));
- log_printf(LOG_INFO, "Using override IP port %d
", portnum);
}
/* our nodename */
if (nodename_env != NULL) {
-
if (strlen(nodename_env) >= sizeof(nodename)) {
- log_printf(LOG_ERR, "Overridden node name %s is too long", nodename);
+ sprintf(error_reason, "Overridden node name %s is too long", nodename);
write_cman_pipe("Overridden node name is too long");
- error = -E2BIG;
+ error = -1;
goto out;
}
if (objdb->object_find(object_handle,
nodename, strlen(nodename),
- &node_object_handle) == 0) {
- log_printf(LOG_ERR, "Overridden node name %s is not in CCS", 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 = -ENOENT;
+ error = -1;
goto out;
}
@@ -423,31 +468,31 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
error = uname(&utsname);
if (error) {
- log_printf(LOG_ERR, "cannot get node name, uname failed");
+ sprintf(error_reason, "cannot get node name, uname failed");
write_cman_pipe("Can't determine local node name");
- error = -ENOENT;
+ error = -1;
goto out;
}
if (strlen(utsname.nodename) >= sizeof(nodename)) {
- log_printf(LOG_ERR, "node name from uname is too long");
+ sprintf(error_reason, "node name from uname is too long");
write_cman_pipe("Can't determine local node name");
- error = -E2BIG;
+ error = -1;
goto out;
}
if (!mcast_name) {
mcast_name = default_mcast(nodename, cluster_id);
- log_printf(LOG_INFO, "Using default multicast address of %s
", mcast_name);
}
/* This will increase as nodes join the cluster */
@@ -752,9 +795,9 @@ static int set_noccs_defaults(struct objdb_iface_ver0 *objdb)
memset(&ahints, 0, sizeof(ahints));
ret = getaddrinfo(nodename, NULL, &ahints, &ainfo);
if (ret) {
- log_printf(LOG_ERR, "Can't determine address family of nodename %s
", nodename);
+ sprintf(error_reason, "Can't determine address family of nodename %s
", nodename);
write_cman_pipe("Can't determine address family of nodename");
- return -EINVAL;
+ return -1;
}
if (ainfo->ai_family == AF_INET) {
@@ -765,7 +808,6 @@ static int set_noccs_defaults(struct objdb_iface_ver0 *objdb)
struct sockaddr_in6 *addr = (struct sockaddr_in6 *)ainfo->ai_addr;
memcpy(&nodeid, &addr->sin6_addr.s6_addr32[3], sizeof(int));
}
- log_printf(LOG_INFO, "Our Node ID is %d
", nodeid);
freeaddrinfo(ainfo);
}
@@ -847,19 +889,9 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin
if (getenv("CMAN_PIPE"))
startup_pipe = atoi(getenv("CMAN_PIPE"));
- /* Initialise early logging */
- if (getenv("CMAN_DEBUGLOG"))
- debug_mask = atoi(getenv("CMAN_DEBUGLOG"));
-
- set_debuglog(debug_mask);
-
/* We need to set this up to internal defaults too early */
openlog("openais", LOG_CONS|LOG_PID, SYSLOGFACILITY);
- /* Enable stderr logging if requested by cman_tool */
- if (debug_mask) {
- logsys_config_subsys_set("CMAN", LOGSYS_TAG_LOG, LOG_DEBUG);
- }
objdb->object_find_reset(OBJECT_PARENT_HANDLE);
objdb->object_find(OBJECT_PARENT_HANDLE,
@@ -876,16 +908,19 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin
if (getenv("CMAN_NOCCS"))
ret = set_noccs_defaults(objdb);
else
- get_cman_globals(objdb);
+ ret = get_cman_globals(objdb);