This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

master - fenced/dlm_controld/gfs_controld: config update reread


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=18fedbfb34778196df1454d46d9f5fb460c11d64
Commit:        18fedbfb34778196df1454d46d9f5fb460c11d64
Parent:        6f0d24469715359fd592e9bbd674cf6f3fb79eb9
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Mon Nov 17 16:21:04 2008 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Mon Nov 17 16:26:52 2008 -0600

fenced/dlm_controld/gfs_controld: config update reread

Reread some daemon config options from ccs when we get
a config-update callback.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 fence/fenced/config.c            |   20 ++++++++++++++------
 fence/fenced/fd.h                |    1 +
 fence/fenced/member_cman.c       |    1 +
 group/dlm_controld/config.c      |   10 ++++++++--
 group/dlm_controld/member_cman.c |    1 +
 group/gfs_controld/config.c      |   11 +++++++++--
 group/gfs_controld/member_cman.c |    1 +
 7 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index 74c6bde..ebc253b 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -129,6 +129,18 @@ static int count_methods(char *victim)
 	return i;
 }
 
+/* These are the options that can be changed while running. */
+
+void reread_ccs(void)
+{
+	if (!optd_post_join_delay)
+		read_ccs_int(POST_JOIN_DELAY_PATH, &cfgd_post_join_delay);
+	if (!optd_post_fail_delay)
+		read_ccs_int(POST_FAIL_DELAY_PATH, &cfgd_post_fail_delay);
+	if (!optd_override_time)
+		read_ccs_int(OVERRIDE_TIME_PATH, &cfgd_override_time);
+}
+
 int read_ccs(struct fd *fd)
 {
 	char path[PATH_MAX];
@@ -157,12 +169,8 @@ int read_ccs(struct fd *fd)
 		read_ccs_int(GROUPD_COMPAT_PATH, &cfgd_groupd_compat);
 	if (!optd_clean_start)
 		read_ccs_int(CLEAN_START_PATH, &cfgd_clean_start);
-	if (!optd_post_join_delay)
-		read_ccs_int(POST_JOIN_DELAY_PATH, &cfgd_post_join_delay);
-	if (!optd_post_fail_delay)
-		read_ccs_int(POST_FAIL_DELAY_PATH, &cfgd_post_fail_delay);
-	if (!optd_override_time)
-		read_ccs_int(OVERRIDE_TIME_PATH, &cfgd_override_time);
+
+	reread_ccs();
 
 	if (!optd_override_path) {
 		str = NULL;
diff --git a/fence/fenced/fd.h b/fence/fenced/fd.h
index 1520838..b04dffb 100644
--- a/fence/fenced/fd.h
+++ b/fence/fenced/fd.h
@@ -200,6 +200,7 @@ struct fd {
 
 int setup_ccs(void);
 void close_ccs(void);
+void reread_ccs(void);
 void read_ccs_name(char *path, char *name);
 void read_ccs_yesno(char *path, int *yes, int *no);
 void read_ccs_int(char *path, int *config_val);
diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c
index 1e199f2..c99215d 100644
--- a/fence/fenced/member_cman.c
+++ b/fence/fenced/member_cman.c
@@ -147,6 +147,7 @@ static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 
 	case CMAN_REASON_CONFIG_UPDATE:
 		setup_logging();
+		reread_ccs();
 		break;
 	}
 }
diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c
index 1460ad6..ff71051 100644
--- a/group/dlm_controld/config.c
+++ b/group/dlm_controld/config.c
@@ -227,6 +227,9 @@ int setup_ccs(void)
 {
 	int i = 0, cd;
 
+	if (ccs_handle)
+		goto update;
+
 	while ((cd = ccs_connect()) < 0) {
 		sleep(1);
 		if (++i > 9 && !(i % 10))
@@ -255,12 +258,15 @@ int setup_ccs(void)
 		read_ccs_int(ENABLE_DEADLK_PATH, &cfgd_enable_deadlk);
 	if (!optd_enable_plock)
 		read_ccs_int(ENABLE_PLOCK_PATH, &cfgd_enable_plock);
+	if (!optd_plock_ownership)
+		read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
+
+	/* The following can be changed while running */
+ update:
 	if (!optd_plock_debug)
 		read_ccs_int(PLOCK_DEBUG_PATH, &cfgd_plock_debug);
 	if (!optd_plock_rate_limit)
 		read_ccs_int(PLOCK_RATE_LIMIT_PATH, &cfgd_plock_rate_limit);
-	if (!optd_plock_ownership)
-		read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
 	if (!optd_drop_resources_time)
 		read_ccs_int(DROP_RESOURCES_TIME_PATH, &cfgd_drop_resources_time);
 	if (!optd_drop_resources_count)
diff --git a/group/dlm_controld/member_cman.c b/group/dlm_controld/member_cman.c
index 28b9a5a..19403f5 100644
--- a/group/dlm_controld/member_cman.c
+++ b/group/dlm_controld/member_cman.c
@@ -149,6 +149,7 @@ static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 		break;
 	case CMAN_REASON_CONFIG_UPDATE:
 		setup_logging();
+		setup_ccs();
 		break;
 	}
 }
diff --git a/group/gfs_controld/config.c b/group/gfs_controld/config.c
index a4195be..8338255 100644
--- a/group/gfs_controld/config.c
+++ b/group/gfs_controld/config.c
@@ -153,6 +153,9 @@ int setup_ccs(void)
 {
 	int i = 0, cd;
 
+	if (ccs_handle)
+		goto update;
+
 	while ((cd = ccs_connect()) < 0) {
 		sleep(1);
 		if (++i > 9 && !(i % 10))
@@ -171,12 +174,15 @@ int setup_ccs(void)
 		read_ccs_int(ENABLE_WITHDRAW_PATH, &cfgd_enable_withdraw);
 	if (!optd_enable_plock)
 		read_ccs_int(ENABLE_PLOCK_PATH, &cfgd_enable_plock);
+	if (!optd_plock_ownership)
+		read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
+
+	/* The following can be changed while running */
+ update:
 	if (!optd_plock_debug)
 		read_ccs_int(PLOCK_DEBUG_PATH, &cfgd_plock_debug);
 	if (!optd_plock_rate_limit)
 		read_ccs_int(PLOCK_RATE_LIMIT_PATH, &cfgd_plock_rate_limit);
-	if (!optd_plock_ownership)
-		read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
 	if (!optd_drop_resources_time)
 		read_ccs_int(DROP_RESOURCES_TIME_PATH, &cfgd_drop_resources_time);
 	if (!optd_drop_resources_count)
@@ -184,6 +190,7 @@ int setup_ccs(void)
 	if (!optd_drop_resources_age)
 		read_ccs_int(DROP_RESOURCES_AGE_PATH, &cfgd_drop_resources_age);
 
+
 	return 0;
 }
 
diff --git a/group/gfs_controld/member_cman.c b/group/gfs_controld/member_cman.c
index eec8ee2..2bd72d0 100644
--- a/group/gfs_controld/member_cman.c
+++ b/group/gfs_controld/member_cman.c
@@ -31,6 +31,7 @@ static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 		break;
 	case CMAN_REASON_CONFIG_UPDATE:
 		setup_logging();
+		setup_ccs();
 		break;
 	}
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]