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.