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

The branch, master has been updated
       via  de5709272c1393b55d1a01468978e393437c3f9f (commit)
      from  13f57ff2d73a9adc1618996c14184559c181974c (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 de5709272c1393b55d1a01468978e393437c3f9f
Author: David Teigland <[EMAIL PROTECTED]>
Date:   Mon Jul 21 11:02:35 2008 -0500

    fenced: munge logging
    
    to prepare for copying it to the other daemons.
    
    Signed-off-by: David Teigland <[EMAIL PROTECTED]>

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

Summary of changes:
 fence/fenced/logging.c |   25 +++++++++++++------------
 fence/fenced/main.c    |    4 ++--
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/fence/fenced/logging.c b/fence/fenced/logging.c
index 51f43be..fc5f11c 100644
--- a/fence/fenced/logging.c
+++ b/fence/fenced/logging.c
@@ -1,9 +1,11 @@
 #include "fd.h"
 #include "config.h"
 
-/* default: errors go to syslog (/var/log/messages) and fenced.log
+#define DAEMON_NAME "fenced"
+
+/* default: errors go to syslog (/var/log/messages) and <daemon>.log
    logging/debug=on: errors continue going to syslog (/var/log/messages)
-   and fenced.log, debug messages are added to fenced.log. */
+   and <daemon>.log, debug messages are added to <daemon>.log. */
 
 #define DEFAULT_MODE           LOG_MODE_OUTPUT_SYSLOG_THREADED | \
                                LOG_MODE_OUTPUT_FILE | \
@@ -11,10 +13,10 @@
                                LOG_MODE_FILTER_DEBUG_FROM_SYSLOG
 #define DEFAULT_FACILITY       SYSLOGFACILITY /* cluster config setting */
 #define DEFAULT_PRIORITY       SYSLOGLEVEL /* cluster config setting */
-#define DEFAULT_FILE           LOGDIR "/fenced.log"
+#define DEFAULT_FILE           LOGDIR "/" DAEMON_NAME ".log"
 
-#define LEVEL_PATH "/cluster/logging/[EMAIL PROTECTED]"FENCED\"]/@syslog_level"
-#define DEBUG_PATH "/cluster/logging/[EMAIL PROTECTED]"FENCED\"]/@debug"
+#define DAEMON_LEVEL_PATH "/cluster/logging/[EMAIL 
PROTECTED]"FENCED\"]/@syslog_level"
+#define DAEMON_DEBUG_PATH "/cluster/logging/[EMAIL PROTECTED]"FENCED\"]/@debug"
 
 /* Read cluster.conf settings and convert them into logsys values.
    If no cluster.conf setting exists, the default that was used in
@@ -95,7 +97,7 @@ static int read_ccs_logging(int *mode, int *facility, int 
*priority, char *file)
        p = DEFAULT_PRIORITY;
 
        memset(name, 0, sizeof(name));
-       read_ccs_name(LEVEL_PATH, name);
+       read_ccs_name(DAEMON_LEVEL_PATH, name);
 
        if (name[0]) {
                val = logsys_priority_id_get(name);
@@ -131,7 +133,7 @@ static int read_ccs_logging(int *mode, int *facility, int 
*priority, char *file)
                cfgd_debug_logsys = 1;
 
        memset(name, 0, sizeof(name));
-       read_ccs_name(DEBUG_PATH, name);
+       read_ccs_name(DAEMON_DEBUG_PATH, name);
 
        if (!strcmp(name, "on"))
                cfgd_debug_logsys = 1;
@@ -145,8 +147,8 @@ static int read_ccs_logging(int *mode, int *facility, int 
*priority, char *file)
 
 void init_logging(void)
 {
-       logsys_init("fenced", DEFAULT_MODE, DEFAULT_FACILITY, DEFAULT_PRIORITY,
-                   DEFAULT_FILE);
+       logsys_init(DAEMON_NAME, DEFAULT_MODE, DEFAULT_FACILITY,
+                   DEFAULT_PRIORITY, DEFAULT_FILE);
 }
 
 /* this function is also called when we get a cman config-update event */
@@ -156,11 +158,10 @@ void setup_logging(void)
        int mode, facility, priority;
        char file[PATH_MAX];
 
-       /* The debug setting is special, it's used by the program
-          and not used to configure logsys. */
+       memset(file, 0, PATH_MAX);
 
        read_ccs_logging(&mode, &facility, &priority, file);
-       logsys_conf("fenced", mode, facility, priority, file);
+       logsys_conf(DAEMON_NAME, mode, facility, priority, file);
 }
 
 void close_logging(void)
diff --git a/fence/fenced/main.c b/fence/fenced/main.c
index c16f074..d3737eb 100644
--- a/fence/fenced/main.c
+++ b/fence/fenced/main.c
@@ -845,9 +845,9 @@ static void read_arguments(int argc, char **argv)
                };
        }
 
-       if (!optd_debug_logsys && getenv("FENCED_DEBUG_LOGSYS")) {
+       if (!optd_debug_logsys && getenv("FENCED_DEBUG")) {
                optd_debug_logsys = 1;
-               cfgd_debug_logsys = atoi(getenv("FENCED_DEBUG_LOGSYS"));
+               cfgd_debug_logsys = atoi(getenv("FENCED_DEBUG"));
        }
 }
 


hooks/post-receive
--
Cluster Project

Reply via email to