[DRBD-user] "drbddisk status resource-name" always returns 0. Is it good for Heartbeat?

Lars Ellenberg Lars.Ellenberg at linbit.com
Mon Nov 27 09:36:57 CET 2006

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


/ 2006-11-25 17:06:40 +0300
\ Igor Yu. Zhbanov:
> Hello!
> 
> I use drbd-0.7.21. And I have written simple resource monitoring script which
> reads Heartbeat resources list (/etc/ha.d/haresources) and for each resource
> invokes its init-script with "status" argument. But my script whows that
> drbddisk is always running. I have looked at it and found this:
> ...
> case "$CMD" in
> ...
>     status)
> 	if [ "$RES" = "all" ]; then
> 	    echo "A resource name is required for status inquiries."
> 	    exit 10
> 	fi
> 	ST=$( $DRBDADM state $RES 2>&1 )
> 	STATE=${ST%/*}
> 	if [ "$STATE" = "Primary" ]; then
> 	    echo "running"
> 	elif [ "$STATE" = "Secondary" ]; then
> 	    echo "stopped"
> 	else
> 	    echo "$ST"
> 	fi
> 	;;
> ...
> So, the exit status from drbddisk is always 0. I think that it is not good for
> resource managers because they didn't know whether resource actually running
> or not.

these resource scripts have been written for heartbeat 1.x
(or the "non-crm" mode of heartbeat 2)
heartbeat _ignores_ the exit value for such scripts
for the "status" operation.
it only parses the output on stdout for "running".
if it contains that word,
the service is consisdered "running".

there also are "ocf" resource scripts and other stuff.
have a look if those suit you better.

-- 
: Lars Ellenberg                                  Tel +43-1-8178292-0  :
: LINBIT Information Technologies GmbH            Fax +43-1-8178292-82 :
: Schoenbrunner Str. 244, A-1120 Vienna/Europe   http://www.linbit.com :
__
please use the "List-Reply" function of your email client.



More information about the drbd-user mailing list