public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* master - cman: add cman_tool -A to disable load of openais services
@ 2008-08-20  8:46 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2008-08-20  8:46 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e741c874e6bfbad5ace5fa2938080c35222a469d
Commit:        e741c874e6bfbad5ace5fa2938080c35222a469d
Parent:        6d104bb9a07f29af88cccd080239054665fd8c42
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Wed Aug 20 08:21:04 2008 +0100
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Aug 20 08:21:04 2008 +0100

cman: add cman_tool -A to disable load of openais services

I have moved the loading of openais services to the control of
the openaisserviceenable configuration module (as it knows better
which services are available). Loading of this module, and
consequently the rest of the openais services is now controlled
by the -A switch.

openais services are enabled by default. -A disables them.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/cman_tool/cman_tool.h   |    1 +
 cman/cman_tool/join.c        |    7 +++++--
 cman/cman_tool/main.c        |    7 ++++++-
 cman/daemon/cman-preconfig.c |   38 --------------------------------------
 cman/man/cman_tool.8         |    7 ++++++-
 5 files changed, 18 insertions(+), 42 deletions(-)

diff --git a/cman/cman_tool/cman_tool.h b/cman/cman_tool/cman_tool.h
index fa55edb..7476e1f 100644
--- a/cman/cman_tool/cman_tool.h
+++ b/cman/cman_tool/cman_tool.h
@@ -90,6 +90,7 @@ struct commandline
 	int addresses_opt;
 	int noconfig_opt;
 	int nosetpri_opt;
+	int noopenais_opt;
 };
 typedef struct commandline commandline_t;
 
diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c
index 98ed2f2..72462d2 100644
--- a/cman/cman_tool/join.c
+++ b/cman/cman_tool/join.c
@@ -100,10 +100,13 @@ int join(commandline_t *comline, char *main_envp[])
 	}
 	if (comline->noconfig_opt) {
 		envp[envptr++] = strdup("CMAN_NOCONFIG=true");
-		envp[envptr++] = strdup("COROSYNC_DEFAULT_CONFIG_IFACE=cmanpreconfig");
+		snprintf(scratch, sizeof(scratch), "COROSYNC_DEFAULT_CONFIG_IFACE=cmanpreconfig%s",
+			 comline->noopenais_opt?"":":openaisserviceenable");
+		envp[envptr++] = strdup(scratch);
 	}
 	else {
-		snprintf(scratch, sizeof(scratch), "COROSYNC_DEFAULT_CONFIG_IFACE=%s:cmanpreconfig", comline->config_lcrso);
+		snprintf(scratch, sizeof(scratch), "COROSYNC_DEFAULT_CONFIG_IFACE=%s:cmanpreconfig%s", comline->config_lcrso,
+			 comline->noopenais_opt?"":":openaisserviceenable");
 		envp[envptr++] = strdup(scratch);
 	}
 
diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c
index 91d2e44..4c6d667 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -9,7 +9,7 @@
 
 #define DEFAULT_CONFIG_MODULE "xmlconfig"
 
-#define OPTION_STRING		("m:n:v:e:2p:c:r:i:N:t:o:k:F:C:VPwfqah?Xd::")
+#define OPTION_STRING		("m:n:v:e:2p:c:r:i:N:t:o:k:F:C:VAPwfqah?Xd::")
 #define OP_JOIN			1
 #define OP_LEAVE		2
 #define OP_EXPECTED		3
@@ -57,6 +57,7 @@ static void print_usage(int subcmd)
 		printf("  -k <file>        Private key file for AIS communications\n");
 		printf("  -P               Don't set aisexec to realtime priority\n");
 		printf("  -X               Use internal cman defaults for configuration\n");
+		printf("  -A               Don't load openais services\n");
 		printf("\n");
 	}
 
@@ -862,6 +863,10 @@ static void decode_arguments(int argc, char *argv[], commandline_t *comline)
 			comline->noconfig_opt = TRUE;
 			break;
 
+		case 'A':
+			comline->noopenais_opt = TRUE;
+			break;
+
 		case 'P':
 			comline->nosetpri_opt = TRUE;
 			break;
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index f90e9a7..4e691f4 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -805,44 +805,6 @@ static void add_cman_overrides(struct objdb_iface_ver0 *objdb)
 				 "corosync_cman", strlen("corosync_cman") + 1);
 	objdb->object_key_create(object_handle, "ver", strlen("ver"),
 				 "0", 2);
-
-	/* Load some other useful openais services too */
-	if (!disable_openais) {
-		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
-				     "service", strlen("service"));
-		objdb->object_key_create(object_handle, "name", strlen("name"),
-					 "openais_ckpt", strlen("openais_ckpt") + 1);
-		objdb->object_key_create(object_handle, "ver", strlen("ver"),
-					 "0", 2);
-
-		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
-				     "service", strlen("service"));
-		objdb->object_key_create(object_handle, "name", strlen("name"),
-					 "openais_evt", strlen("openais_evt") + 1);
-		objdb->object_key_create(object_handle, "ver", strlen("ver"),
-					 "0", 2);
-
-		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
-				     "service", strlen("service"));
-		objdb->object_key_create(object_handle, "name", strlen("name"),
-					 "openais_msg", strlen("openais_msg") + 1);
-		objdb->object_key_create(object_handle, "ver", strlen("ver"),
-					 "0", 2);
-
-		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
-				     "service", strlen("service"));
-		objdb->object_key_create(object_handle, "name", strlen("name"),
-					 "openais_clm", strlen("openais_clm") + 1);
-		objdb->object_key_create(object_handle, "ver", strlen("ver"),
-					 "0", 2);
-
-		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
-				     "service", strlen("service"));
-		objdb->object_key_create(object_handle, "name", strlen("name"),
-					 "openais_lck", strlen("openais_lck") + 1);
-		objdb->object_key_create(object_handle, "ver", strlen("ver"),
-					 "0", 2);
-	}
 }
 
 /* If ccs is not available then use some defaults */
diff --git a/cman/man/cman_tool.8 b/cman/man/cman_tool.8
index 06d264a..f0cb90d 100644
--- a/cman/man/cman_tool.8
+++ b/cman/man/cman_tool.8
@@ -267,7 +267,12 @@ add two modules (eg) 'ldapconfig' and 'ldappreproc' to the chain start cman with
 .br
 The default value for this is 'ccsconfig'. Note that if the -X is on the command-line
 then -C will be ignored.
-
+.TP
+.I -A
+Don't load openais services. Normally cman_tool join will load the configuration
+module 'openaisserviceenable' which will load the services installed by openais.
+If you don't want to use these services or have not installed openais then
+this switch will disable them.
 .SH "NODES" OPTIONS
 .TP
 .I -f


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

only message in thread, other threads:[~2008-08-20  7:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20  8:46 master - cman: add cman_tool -A to disable load of openais services 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).