[Pacemaker] ocf_log

Steve Kwee skwee at itw.de
Mon Apr 20 11:05:07 EDT 2009


Andrew Beekhof <beekhof at ...> writes:

> 
> On Fri, Apr 17, 2009 at 18:34, Steve Kwee <skwee at ...> wrote:
> > Steve Kwee <skwee at ...> writes:
> 
> > Question:
> > I configured a lsb:heartbeat:Stateful dummy resource and did
> 
> I hope you typed lsb but meant ocf, otherwise the lrmd has a bug.
> 
> > ocf_log debug "xxx"
> > ocf_log info "xxx"
> > in a monitor op every 5s
> > I can see the ocf_log info in the syslog but the ocf_log debug never appears
> >
> > I tried all from
> > debug 1
> > debug on
> > debug true
> > debug yes
> >
> > I patched /etc/ha.d/shellfuncs to
> > ha_debug() {
> >
> >        # SKW
> >        echo "`date` skw $HA_debug" >> /var/log/ocf-debug.log
> >
> >        if [ "x${HA_debug}" = "x0" ] ; then
> >                return 0
> >        fi
> >        ....
> > and I found that HA_debug is always "0" whatever I put to ha.cf
> 
> Can you paste the initial openais startup messages pls?  grep
> "openais.*CRM" /var/log/...
> 
> > What I was searching for was a way to dynamicall change the loglevel
> > of ocf_log for the OCF-RAs. It seems to me that this should be
> > implemented in
> > .ocf-shellfuncs:ocf_log
> > This is in the package heartbeat-resources so I don't know if this
> > is the appropriate mailing list.
> 
> Correct.  Try the linux-ha list.
> 

1. Sorry, of course it should be ocf:heartbeat:Stateful.

2. openAIS does respond to the debug on/off flag. This changes
the logging-behaviour of the openAIS subprocesses.
According to the openais.conf manpage the correct setting is "on" or "off".
The logging-behaviour of the openAIS subprocesses can be changed dynamically
with SIGUSR1 and SIGUSR2.

The debug flag is propagated to the RA as HA_debug with a value of "0" or "1"
This is evaluated in /etc/ha.d/shellfuncs in ha_debug

So everything seems to be okay, and maybe I got in trouble with the difference
between on/true/1 off/false/0.

One minor glitch might be, that the propagated HA_debug does not respond 
to the SIGUSR1 SIGUSR2 signals as the general log messages of lrmd do.
So one can not dynamically change the debugging behaviour of RA.

In the logfile I found
Apr 20 16:21:20 vh07 openais[11470]: [MAIN ] info: get_config_opt: Found 'on'
for option: debug
and
Apr 20 16:16:41 vh07 openais[29893]: [MAIN ] info: get_config_opt: Found 'off'
for option: debug

Attached is the output of 
less /var/log/messages | egrep openais.*crm
after a stop and restart of openais

Apr 20 16:44:43 vh07 openais[25101]: [crm  ] notice: pcmk_shutdown: Forcing clea
n exit of OpenAIS
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: process_ais_conf: Reading conf
igure
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_plugin_init: CRM: Initial
ized
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] Logging: Initialized pcmk_plugin_ini
t
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_plugin_init: Service: 9
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_plugin_init: Local node i
d: 184615178
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_plugin_init: Local hostna
me: vh07
Apr 20 16:45:04 vh07 openais[2116]: [MAIN ] info: spawn_child: Forked child 2127
 for process crmd
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_startup: CRM: Initialized
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] notice: pcmk_peer_update: Transition
al membership event on ring 356: memb=0, new=0, lost=0
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] notice: pcmk_peer_update: Stable mem
bership event on ring 356: memb=1, new=1, lost=0
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: NEW:  vh07 1
84615178
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: MEMB: vh07 1
84615178
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_ipc: Recorded connection 
0x7f92bc037950 for attrd/2125
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_ipc: Recorded connection 
0x7f92bc0376f0 for cib/2123
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_ipc: Sending membership u
pdate 356 to cib
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_ipc: Recorded connection 
0x7f92bc037260 for stonithd/2122
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] notice: pcmk_peer_update: Transition
al membership event on ring 360: memb=1, new=0, lost=0
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: memb: vh07 1
84615178
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] notice: pcmk_peer_update: Stable mem
bership event on ring 360: memb=2, new=1, lost=0
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: NEW:  .pendi
ng. 151060746
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: MEMB: .pendi
ng. 151060746
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: pcmk_peer_update: MEMB: vh07 1
84615178
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: send_member_notification: Send
ing membership update 360 to 1 children
Apr 20 16:45:04 vh07 openais[2116]: [crm  ] info: send_member_notification: Send
ing membership update 360 to 1 children






More information about the Pacemaker mailing list