[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] logsys in fenced



On Wed, 25 Jun 2008, David Teigland wrote:

commit 95a5c6b13294742956b13070ebc4f4513278255f
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jun 25 06:24:11 2008 +0200

    [FENCE] fenced: separate concept of fork and debugging

    allow fenced to fork when debugging is set from the configuration
    or the system will hang at boot.

    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit da704715c606c9c01637ae53d79f8dec6a8b0389
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jun 25 05:19:35 2008 +0200

    [FENCE] Allow fenced to configure logsys

    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit 18e085596bb8844f74689a92662f2e5e9166836b
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jun 25 04:49:41 2008 +0200

    [FENCE] Move logsys configuration calls where they belong

    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit c54c56c5a09f98547ceda3bc5fa9afa28b354480
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jun 25 04:23:20 2008 +0200

    [FENCE] Make fenced ready to load logsys config

    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit cf4c7ebac813b0b607acf6cf74bbdddfc8cfb12a
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Tue Jun 24 14:34:35 2008 +0200

    [FENCE] Start porting fenced to logsys

    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

OK, I'm fine with replacing the use of syslog with logsys, but this goes
beyond that.  Here are the problems I see:


. Leave log_debug() unchanged,

The only change is that it uses logsys to print instead fprintf to stderr. Like Christine already pointed out, the change to logsys is to have log output the same across the whole system. No exceptions. Debug is no different from that, and with logsys you can set debug logs at runtime instead of having to do manual things.

and leave the meaning/effect of -D unchanged.

This is unchanged. Read carefully what I did. By setting debug_daemon_opt to 1, (also set by debug=on config option) you can theoretically halt the machine boot (if you need to debug that early in the process).

Invoking with -D will also avoid forking of the daemon (fork_daemon_opt or whatever i called it).

Original behaviour preserverd. Add more flexibility to debug.

 syslog/logsys are about logging to files.

this is an assumption. logsys allows you to log to file, syslog and stderr according to what you need.

 The debug "logging" I use is
 about logging to either an in-memory buffer or to stderr; syslog/logsys
 are not relevant to that.

What is wrong with collecting debugging info in a standard way?



. Change log_error() to use logsys instead of syslog, i.e. don't change
 the existing log_error() call sites.

 #define log_error(fmt, args...) \
 do { \
	log_debug(fmt, ##args); \
 -	syslog(LOG_ERR, fmt, ##args); \
 + 	log_printf(LOG_ERR, fmt, ##args); \
 } while (0)

and what's the gain to keep around a macro that does nothing vs calling directly log_printf?



. Finally, one gripe with logsys itself.  Here's syslog initialization:


Discuss this with Steven.

Fabio

--
I'm going to make him an offer he can't refuse.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]