Hi,

I know this is a very old thread.

But I'm now trying heartbeat 2.99.2 (from the provided rpm packages) and I 
still have these 'local's in the drbd script.

Is this normal ? Has the bug been corrected ?


On Monday 17 November 2008 12:35:20 Dejan Muhamedagic wrote:
> Hi,
>
> On Fri, Nov 14, 2008 at 09:13:54AM +0100, Marc Cousin wrote:
> > Hi,
> >
> > I've been fighting with the OCF DRBD script returning me success when
> > trying to get a resource secondary, when it failed : the drbdadm
> > secondary command fails (returns 11) and the drbd script returns 0. It's
> > with heartbeat 2.1.4.
> >
> > I think I've located the culprit :
> >
> > do_drbdadm() {
> > ?????????????? local cmd="$DRBDADM -c $DRBDCONF $*"
> > ?????????????? ocf_log debug "$RESOURCE: Calling $cmd"
> > ?????????????? local cmd_out=$($cmd 2>&1)
> > ?????????????? ret=$?
> > ?????????????? # Trim the garbage drbdadm likes to print when using the
> > node ?????????????? # override feature:
> > ?????????????? local cmd_ret=$(echo $cmd_out | sed -e 's/found
> > __DRBD_NODE__.*<<//;') ?????????????? if [ $ret -ne 0 ]; then
> > ?????????????????????????????? ocf_log err "$RESOURCE: Called $cmd"
> > ?????????????????????????????? ocf_log err "$RESOURCE: Exit code $ret"
> > ?????????????????????????????? ocf_log err "$RESOURCE: Command output:
> > $cmd_ret" ?????????????? else
> > ?????????????????????????????? ocf_log debug "$RESOURCE: Exit code $ret"
> > ?????????????????????????????? ocf_log debug "$RESOURCE: Command output:
> > $cmd_ret" ?????????????? fi
> > ?????????????? echo $cmd_ret
> > ?????????????? return $ret
> > }
> >
> >
> >         local cmd_out=$($cmd 2>&1)
> >         ret=$?
> >
> > In this case $? always is 0. As I don't know sh that much (and hate it a
> > lot :) ), I've been trying to find the reason, and as soon as I remove
> > the 'local', the return code is transmitted to $? again.
>
> True. Interesting that nobody found this before.
>
> > This is quite an important problem I think, because whenever heartbeat
> > fails to do a drbd command, it thinks it has worked (instead of
> > retrying).
>
> Fixed in the development repository.
>
> Cheers,
>
> Dejan
>
> > _______________________________________________
> > Linux-HA mailing list
> > [email protected]
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha
> > See also: http://linux-ha.org/ReportingProblems
>
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems


_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to