> 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.
>
i can confirm this. if there is a "local" before cmd_out the $ret
variable isn't filled with the return-code and it is all the time 0 even
if drbdadm failed.
i've also a other problem with "cleanup": if i cleanup the drbd resource
in a working state, then heartbeat/pacemaker tells most of the times
"multiple-running" on the same host. after that i have to stop the
resource, then cleanup and start it. one or two times i had to manual
"drbdadm down <resource>" on both nodes to get to a good state.
- Thomas
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems