[Pacemaker] Log STDERR from OCF scripts

Michal Fiala fiala at mfiala.net
Fri Dec 21 12:16:45 UTC 2012


Hallo,

we use corosyng logging via syslog (to_logfile: no; to_syslog: yes;
syslog_facility: local0; debug: on). Some OCF scripts do not use OCF API
to execute commands. I mean function ocf_run, which capture STDOUT and
STDERR. For example linbit/drbd uses its own function to execute
do_cmd(), which does not capture STDERR. So you can not see STDERR
output in corosync log file.
I have discuss this problem on drbd-user mailing list and they mean,
that capturing STDERR should be done by lrmd.

Communication from drbd-user mailing list:

Q: Is there a way how to capture stderr from
/usr/lib/ocf/resource.d/linbit/drbd? I can simply patch ocf script, or
better this could be a global, permanent fix from developers.

A: We deliberately chose to do it this way.
Besides the drbd.ocf predates ocf_run(), I think,
and is supposed to also work on clusters not providing this.

The cluster-glue lrmd used to capture both stdout and stderr,
and logged it accordingly.

The pacemaker 1.1.8 rewritten-from-scratch lrmd
apparently does not (yet).

If you "fix" our do_cmd() in the way you propose to,
you'll break the drbd ocf resource agent,
because we use it in nested ways: X=$(do_cmd something else),
and expect *exactly* the stdout of somthing else there.

So don't do that.

If anything, this needs to be fixed in the rewritten-from-scratch
pacemaker lrmd.

details see:
http://lists.linbit.com/pipermail/drbd-user/2012-December/019416.html

How can I solve capturing STDERR?

Thanks

Michal





More information about the Pacemaker mailing list