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]

Cluster Project branch, master, updated. cluster-2.99.06-33-ge9c7fd5


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=e9c7fd5bec2bb2479229e33fed2d477a0377451f

The branch, master has been updated
       via  e9c7fd5bec2bb2479229e33fed2d477a0377451f (commit)
      from  9d2109d1559a9bb9bb29a7178d084ab744bdc1a1 (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 e9c7fd5bec2bb2479229e33fed2d477a0377451f
Author: David Teigland <teigland@redhat.com>
Date:   Fri Jul 18 11:04:29 2008 -0500

    fenced: debug logsys options
    
    Enable/disable logsys debugging in the following ways, in order of priority:
    . command line -L [0|1]
    . environment variable FENCED_DEBUG_LOGSYS [0|1]
    . cluster.conf logging/logger_subsys/debug [off|on]
    . cluster.conf logging/debug  [off|on]
    
    Signed-off-by: David Teigland <teigland@redhat.com>

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

Summary of changes:
 fence/fenced/config.c      |    2 ++
 fence/fenced/config.h      |    3 +++
 fence/fenced/cpg.c         |    1 +
 fence/fenced/fd.h          |    5 ++---
 fence/fenced/group.c       |    1 +
 fence/fenced/logging.c     |   17 ++++++++++-------
 fence/fenced/main.c        |   16 +++++++++++++---
 fence/fenced/member_cman.c |    3 ++-
 8 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/fence/fenced/config.c b/fence/fenced/config.c
index 046112f..791150c 100644
--- a/fence/fenced/config.c
+++ b/fence/fenced/config.c
@@ -7,6 +7,7 @@ static int ccs_handle;
 /* was a config value set on command line?, 0 or 1. */
 
 int optd_groupd_compat;
+int optd_debug_logsys;
 int optd_clean_start;
 int optd_post_join_delay;
 int optd_post_fail_delay;
@@ -16,6 +17,7 @@ int optd_override_path;
 /* actual config value from command line, cluster.conf, or default. */
 
 int cfgd_groupd_compat   = DEFAULT_GROUPD_COMPAT;
+int cfgd_debug_logsys    = DEFAULT_DEBUG_LOGSYS;
 int cfgd_clean_start     = DEFAULT_CLEAN_START;
 int cfgd_post_join_delay = DEFAULT_POST_JOIN_DELAY;
 int cfgd_post_fail_delay = DEFAULT_POST_FAIL_DELAY;
diff --git a/fence/fenced/config.h b/fence/fenced/config.h
index 3d919ac..4ee9522 100644
--- a/fence/fenced/config.h
+++ b/fence/fenced/config.h
@@ -2,6 +2,7 @@
 #define __CONFIG_DOT_H__
 
 #define DEFAULT_GROUPD_COMPAT 1
+#define DEFAULT_DEBUG_LOGSYS 0
 #define DEFAULT_CLEAN_START 0
 #define DEFAULT_POST_JOIN_DELAY 6
 #define DEFAULT_POST_FAIL_DELAY 0
@@ -9,6 +10,7 @@
 #define DEFAULT_OVERRIDE_PATH "/var/run/cluster/fenced_override"
 
 extern int optd_groupd_compat;
+extern int optd_debug_logsys;
 extern int optd_clean_start;
 extern int optd_post_join_delay;
 extern int optd_post_fail_delay;
@@ -16,6 +18,7 @@ extern int optd_override_time;
 extern int optd_override_path;
 
 extern int cfgd_groupd_compat;
+extern int cfgd_debug_logsys;
 extern int cfgd_clean_start;
 extern int cfgd_post_join_delay;
 extern int cfgd_post_fail_delay;
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index ac6fb0a..9460c18 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -1,4 +1,5 @@
 #include "fd.h"
+#include "config.h"
 
 static unsigned int protocol_active[3] = {1, 0, 0};
 
diff --git a/fence/fenced/fd.h b/fence/fenced/fd.h
index e16da90..c6c6118 100644
--- a/fence/fenced/fd.h
+++ b/fence/fenced/fd.h
@@ -59,7 +59,6 @@
 #define GROUP_LIBCPG            3
 
 extern int daemon_debug_opt;
-extern int daemon_debug_logsys;
 extern int daemon_quit;
 extern struct list_head domains;
 extern int cman_quorate;
@@ -79,7 +78,7 @@ do { \
 	daemon_dump_save(); \
 	if (daemon_debug_opt) \
 		fprintf(stderr, "%s", daemon_debug_buf); \
-	if (daemon_debug_logsys) \
+	if (cfgd_debug_logsys) \
 		log_printf(LOG_DEBUG, "%s", daemon_debug_buf); \
 } while (0)
 
@@ -262,7 +261,7 @@ void fence_victims(struct fd *fd);
 /* logging.c */
 
 void init_logging(void);
-void setup_logging(int *prog_debug);
+void setup_logging();
 void close_logging(void);
 
 #endif				/*  __FD_DOT_H__  */
diff --git a/fence/fenced/group.c b/fence/fenced/group.c
index d546ec4..981a94b 100644
--- a/fence/fenced/group.c
+++ b/fence/fenced/group.c
@@ -1,4 +1,5 @@
 #include "fd.h"
+#include "config.h"
 #include "libgroup.h"
 
 #define DO_STOP 1
diff --git a/fence/fenced/logging.c b/fence/fenced/logging.c
index 7f9d90b..51f43be 100644
--- a/fence/fenced/logging.c
+++ b/fence/fenced/logging.c
@@ -1,4 +1,5 @@
 #include "fd.h"
+#include "config.h"
 
 /* default: errors go to syslog (/var/log/messages) and fenced.log
    logging/debug=on: errors continue going to syslog (/var/log/messages)
@@ -38,8 +39,7 @@
    "/cluster/logging/logger_subsys[@subsys=\"prog_name\"]/@debug"
 */
 
-static int read_ccs_logging(int *mode, int *facility, int *priority, char *file,
-			    int *debug)
+static int read_ccs_logging(int *mode, int *facility, int *priority, char *file)
 {
 	char name[PATH_MAX];
 	int val, y, n;
@@ -121,19 +121,22 @@ static int read_ccs_logging(int *mode, int *facility, int *priority, char *file,
 	 * debug
 	 */
 
+	if (optd_debug_logsys)
+		return 0;
+
 	memset(name, 0, sizeof(name));
 	read_ccs_name("/cluster/logging/@debug", name);
 
 	if (!strcmp(name, "on"))
-		*debug = 1;
+		cfgd_debug_logsys = 1;
 
 	memset(name, 0, sizeof(name));
 	read_ccs_name(DEBUG_PATH, name);
 
 	if (!strcmp(name, "on"))
-		*debug = 1;
+		cfgd_debug_logsys = 1;
 	else if (!strcmp(name, "off"))
-		*debug = 0;
+		cfgd_debug_logsys = 0;
 
 	return 0;
 }
@@ -148,7 +151,7 @@ void init_logging(void)
 
 /* this function is also called when we get a cman config-update event */
 
-void setup_logging(int *prog_debug)
+void setup_logging(void)
 {
 	int mode, facility, priority;
 	char file[PATH_MAX];
@@ -156,7 +159,7 @@ void setup_logging(int *prog_debug)
 	/* The debug setting is special, it's used by the program
 	   and not used to configure logsys. */
 
-	read_ccs_logging(&mode, &facility, &priority, file, prog_debug);
+	read_ccs_logging(&mode, &facility, &priority, file);
 	logsys_conf("fenced", mode, facility, priority, file);
 }
 
diff --git a/fence/fenced/main.c b/fence/fenced/main.c
index decae46..c16f074 100644
--- a/fence/fenced/main.c
+++ b/fence/fenced/main.c
@@ -624,7 +624,7 @@ static void loop(void)
 	if (rv < 0)
 		goto out;
 
-	setup_logging(&daemon_debug_logsys);
+	setup_logging();
 
 	group_mode = GROUP_LIBCPG;
 
@@ -745,6 +745,7 @@ static void print_usage(void)
 	printf("Options:\n");
 	printf("\n");
 	printf("  -D           Enable debugging code and don't fork\n");
+	printf("  -L <num>     Enable (1) or disable (0) debugging to logsys (default %d)\n", DEFAULT_DEBUG_LOGSYS);
 	printf("  -g <num>     groupd compatibility, 0 off, 1 on\n");
 	printf("               on: use libgroup, compat with cluster2/stable2/rhel5\n");
 	printf("               off: use libcpg, no backward compatability\n");
@@ -763,7 +764,7 @@ static void print_usage(void)
 	printf("\n");
 }
 
-#define OPTION_STRING	"g:cj:f:Dn:O:T:hVS"
+#define OPTION_STRING	"L:g:cj:f:Dn:O:T:hVS"
 
 static void read_arguments(int argc, char **argv)
 {
@@ -779,6 +780,11 @@ static void read_arguments(int argc, char **argv)
 			daemon_debug_opt = 1;
 			break;
 
+		case 'L':
+			optd_debug_logsys = 1;
+			cfgd_debug_logsys = atoi(optarg);
+			break;
+
 		case 'g':
 			optd_groupd_compat = 1;
 			cfgd_groupd_compat = atoi(optarg);
@@ -838,6 +844,11 @@ static void read_arguments(int argc, char **argv)
 			exit(EXIT_FAILURE);
 		};
 	}
+
+	if (!optd_debug_logsys && getenv("FENCED_DEBUG_LOGSYS")) {
+		optd_debug_logsys = 1;
+		cfgd_debug_logsys = atoi(getenv("FENCED_DEBUG_LOGSYS"));
+	}
 }
 
 static void set_oom_adj(int val)
@@ -895,7 +906,6 @@ void daemon_dump_save(void)
 }
 
 int daemon_debug_opt;
-int daemon_debug_logsys;
 int daemon_quit;
 struct list_head domains;
 int cman_quorate;
diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c
index ae8957e..7820d64 100644
--- a/fence/fenced/member_cman.c
+++ b/fence/fenced/member_cman.c
@@ -1,4 +1,5 @@
 #include "fd.h"
+#include "config.h"
 #include <libcman.h>
 
 #define BUFLEN		MAX_NODENAME_LEN+1
@@ -124,7 +125,7 @@ static void cman_callback(cman_handle_t h, void *private, int reason, int arg)
 		break;
 
 	case CMAN_REASON_CONFIG_UPDATE:
-		setup_logging(&daemon_debug_logsys);
+		setup_logging();
 		break;
 	}
 }


hooks/post-receive
--
Cluster Project


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