public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fenced: check for group/groupd_compat at startup
@ 2009-02-27 15:42 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-02-27 15:42 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8c965b6011f82f0a889ed790fdb35df8e3593089
Commit:        8c965b6011f82f0a889ed790fdb35df8e3593089
Parent:        3fed2f6c704c711efe5dfe0d065e3c1691837c23
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Fri Feb 27 09:36:06 2009 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Fri Feb 27 09:39:28 2009 -0600

fenced: check for group/groupd_compat at startup

It was being read along with the other ccs values, which happens at
domain join time, not at startup like other daemons.  groupd_compat
needs to be checked at startup.

Also remove the check it was doing that the local cman node name is
in ccs, I don't think that's ever possible.

Also fix the section name to <group/> in groupd man page.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 fence/fenced/config.c |   63 ++++++++++++++++++------------------------------
 group/man/groupd.8    |    6 ++--
 2 files changed, 27 insertions(+), 42 deletions(-)

diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index e40d653..4410bba 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -26,25 +26,6 @@ int cfgd_post_fail_delay = DEFAULT_POST_FAIL_DELAY;
 int cfgd_override_time   = DEFAULT_OVERRIDE_TIME;
 char *cfgd_override_path = DEFAULT_OVERRIDE_PATH;
 
-int setup_ccs(void)
-{
-	int cd;
-
-	cd = ccs_connect();
-	if (cd < 0) {
-		log_error("ccs_connect error %d %d", cd, errno);
-		return -1;
-	}
-	ccs_handle = cd;
-
-	return 0;
-}
-
-void close_ccs(void)
-{
-	ccs_disconnect(ccs_handle);
-}
-
 void read_ccs_name(char *path, char *name)
 {
 	char *str;
@@ -102,7 +83,6 @@ void read_ccs_int(char *path, int *config_val)
 	free(str);
 }
 
-#define OUR_NAME_PATH "/cluster/clusternodes/clusternode[@name=\"%s\"]/@name"
 #define GROUPD_COMPAT_PATH "/cluster/group/@groupd_compat"
 #define CLEAN_START_PATH "/cluster/fence_daemon/@clean_start"
 #define POST_JOIN_DELAY_PATH "/cluster/fence_daemon/@post_join_delay"
@@ -140,6 +120,8 @@ void reread_ccs(void)
 		read_ccs_int(OVERRIDE_TIME_PATH, &cfgd_override_time);
 }
 
+/* called when the domain is joined, not when the daemon starts */
+
 int read_ccs(struct fd *fd)
 {
 	char path[PATH_MAX];
@@ -147,25 +129,6 @@ int read_ccs(struct fd *fd)
 	int error, i = 0, count = 0;
 	int num_methods;
 
-	/* Our own nodename must be in cluster.conf before we're allowed to
-	   join the fence domain and then mount gfs; other nodes need this to
-	   fence us. */
-
-	str = NULL;
-	memset(path, 0, sizeof(path));
-	snprintf(path, sizeof(path), OUR_NAME_PATH, our_name);
-
-	error = ccs_get(ccs_handle, path, &str);
-	if (error || !str) {
-		log_error("local cman node name \"%s\" not found in the "
-			  "configuration", our_name);
-		return error;
-	}
-	if (str)
-		free(str);
-
-	if (!optd_groupd_compat)
-		read_ccs_int(GROUPD_COMPAT_PATH, &cfgd_groupd_compat);
 	if (!optd_clean_start)
 		read_ccs_int(CLEAN_START_PATH, &cfgd_clean_start);
 
@@ -229,3 +192,25 @@ int read_ccs(struct fd *fd)
 	return 0;
 }
 
+int setup_ccs(void)
+{
+	int cd;
+
+	cd = ccs_connect();
+	if (cd < 0) {
+		log_error("ccs_connect error %d %d", cd, errno);
+		return -1;
+	}
+	ccs_handle = cd;
+
+	if (!optd_groupd_compat)
+		read_ccs_int(GROUPD_COMPAT_PATH, &cfgd_groupd_compat);
+
+	return 0;
+}
+
+void close_ccs(void)
+{
+	ccs_disconnect(ccs_handle);
+}
+
diff --git a/group/man/groupd.8 b/group/man/groupd.8
index 3a0677e..4772854 100644
--- a/group/man/groupd.8
+++ b/group/man/groupd.8
@@ -17,7 +17,7 @@ no longer require this compat layer, and can run without groupd.  They use
 libcpg directly, making them much more robust.  This makes them incompatible
 with old (cluster2) versions.  Enable this new mode with:
 
-	<groupd groupd_compat="0"/>
+	<group groupd_compat="0"/>
 
 This should be added to the configuration (cluster.conf) before a cluster is
 restarted following an upgrade of all nodes.
@@ -26,7 +26,7 @@ If compatibility with old (cluster2) nodes is necessary (mixing cluster2 and
 cluster3 nodes should be avoided), the daemons can be run in the old mode,
 using groupd as before.  Enable this mode with:
 
-	<groupd groupd_compat="1"/>
+	<group groupd_compat="1"/>
 
 .B Rolling Upgrades
 
@@ -41,7 +41,7 @@ the final groupd_compat result (0 or 1) from groupd.
 This groupd_compat="2" mode only supports rolling upgrades, and will not
 support mixing cluster2 and cluster3 nodes in general.  Once all nodes are
 upgraded, the first full cluster restart should be used to specify the new
-mode <groupd groupd_compat="0"/> in the configuration (cluster.conf).
+mode <group groupd_compat="0"/> in the configuration (cluster.conf).
 
 .B Logging
 


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

only message in thread, other threads:[~2009-02-27 15:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-27 15:42 cluster: STABLE3 - fenced: check for group/groupd_compat at startup David Teigland

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).