[Linux-ha-dev] cl_log questions

Guochun Shi gshi at ncsa.uiuc.edu
Mon Dec 20 10:58:14 MST 2004


Hi, Roberto,

At 12:24 PM 12/20/2004 +0100, you wrote:
>Hello,
>
>I'm trying to understand the behaviour of cl_log() during various transitional phases. The problem we're facing is that when we boot a node of a cluster we get 4 messages from heartbeat on console, although syslog-ng is started before and to our avail is configured correctly:
>
>heartbeat[928]: info: Starting "/usr/opt/heartbeat/lib/heartbeat/ipfail" as uid 0  gid 0 (pid 928)
>heartbeat[929]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL
>heartbeat[930]: info: Local Resource acquisition completed.
>heartbeat[1000]: debug: notify_world: setting SIGCHLD Handler to SIG_DFL

Normally you should see no messages in console. Only when some error happens in logging a message that the message will be sent to console.

>Two things strike me as particularly odd: we have no debug statement in /etc/ha.d/ha.cf and syslog-ng is running, all future log statements make it in to the designated file.
>
>I'm of course ready to belief and acknowledge that there is some configuration mistake in our setup but I'd be very happy to get some information from someone that might face the same issues.
>
>To get a bit more on-topic: I think from recalling the source I've once seen on cl_log() that it is defined to G_GNUC_PRINTF(2,3) which again I once found in src/glib/gmacros.h (or GLIBC headers if you want) to be defined as follows:
>
>#define G_GNUC_PRINTF( format_idx, arg_idx )    \
>      __attribute__((format (printf, format_idx, arg_idx)))
>
>Interestingly in heartbeat.c we sometimes have following construct:
>
>    cl_log(LOG_INFO|LOG_ERR ...)
>
>and sometimes the following construct:
>
>    if (ANYDEBUG) {
>        cl_log(LOG_DEBUG ...)
>    }
cl_log(LOG_INFO|LOG_ERR,...) is the normal log function with information or error at the beginning of the message
ANYDEBUG is enable as long as you set debug >=1 in ha.cf


>Does the cl in cl_log() refer to cluster log or command line log? What is the reason to not send those messages to syslog? Am I forgetting something?

I think cluster log makes more sense :). There are other files like cl_msg.c cl_signal.c.... I believe it is cluster <something> shorten to cl :)

By sending a message to syslog, that message will be in /var/log/messages, have you checked that?

-Guochun



More information about the Linux-HA-Dev mailing list