[Pacemaker] Log STDERR from OCF scripts
Andrew Beekhof
andrew at beekhof.net
Wed Jan 2 12:00:31 UTC 2013
On Fri, Dec 21, 2012 at 11:16 PM, Michal Fiala <fiala at mfiala.net> wrote:
> 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).
Not true. It is both captured and logged. The severity depends on a
number of factors.
So you might need to enable debug to get stderr from actions that didn't "fail".
>
> 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
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
More information about the Pacemaker
mailing list