[Linux-HA] R1 to R2 testing: cib.xml & ldirectord questions for 2 node cluster

Peter Farrell peter.d.farrell at gmail.com
Tue Sep 11 14:11:34 MDT 2007


Hi Andreas - thanks for the tip.

RE: "OCF compliant resource agent for ldirectord"

Does that mean - use a definition other than "IPaddr" in the XML or
does that mean use the mythical wrapper script for ldirectord?

I found what was listed as an  "example script" written by yourself on
a mailing list - I'll paste it in below and you can tell me if it's
what I need.

I have seen several back and forth messages touching on this subject
in the last few months - but never anything concrete. Is this now
available in the source?
Earlier I looked up the fix in Bugzilla for Linux-HA (#105) and it
seemed dead to me.

-thanks again.
-Peter Farrell

==================================================
#!/bin/sh
#
#       ldirectord OCF RA. Wrapper around /usr/sbin/ldirectord to
#       be OCF RA compliant and therefore to get the possibility
#   to monitor ldirectord by HAv2.
#   Tested on SuSE Linux Enterprise Server 10. Probably you
#   have to adjust the variables LDIRECTORD and the path to
#   /usr/lib/heartbeat/ocf-shellfuncs.
#
#   Should conform to the specification found at
#    http://www.linux-ha.org/OCFResourceAgent
#   and
#   http://www.opencf.org/cgi-bin/viewcvs.cgi/specs/ra/resource-agent-api.txt?rev=HEAD
#
#   ToDo: Add parameter to start several instances of ldirectord
#   with different config files.
#
# Copyright (c) 2007 Andreas Mock (andreas.mock at web.de)
#                    All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like.  Any license provided herein, whether implied or
# otherwise, applies only to this software file.  Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#

#######################################################################
# Initialization:

. /usr/lib/heartbeat/ocf-shellfuncs
# Check in which environment you're working
#. /usr/lib64/heartbeat/ocf-shellfuncs

#######################################################################
LDIRECTORD=/usr/sbin/ldirectord

meta_data() {
       cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="Ldirectord" version="0.9">
<version>1.0</version>

<longdesc lang="en">
It's a simple OCF RA wrapper for ldirectord and uses the ldirectord interface
to create the OCF compliant interface. You win monitoring of ldirectord.
Be warned: Asking ldirectord status is an expensive action.
</longdesc>
<shortdesc lang="en">Wrapper OCF Resource Agent for ldirectord</shortdesc>
<parameters />
<actions>
<action name="start"   timeout="15" />
<action name="stop"    timeout="15" />
<action name="monitor" depth="0"  timeout="10" interval="20" />
<action name="meta-data"  timeout="10" />
<action name="verify-all"  timeout="10" />
</actions>
</resource-agent>
END
}

#######################################################################

ldirectord_usage() {
       cat <<END
usage: $0 {start|stop|monitor|validate-all|meta-data}

Expects to have a fully populated OCF RA-compliant environment set.
END
}

ldirectord_exit() {
   exit $1
}

ldirectord_start() {
   $LDIRECTORD start
}

ldirectord_stop() {
   $LDIRECTORD stop
}

ldirectord_status() {
   OUTPUT=`$LDIRECTORD status 2>&1`
   case $? in
       1)  echo $OUTPUT
           return $OCF_ERR_GENERIC
           ;;
       0)  echo running
           return $OCF_SUCCESS
           ;;
       3)  echo stopped
           return $OCF_SUCCESS
           ;;
       *)  echo $OUTPUT
           return $OCF_ERR_GENERIC
           ;;
   esac
}

ldirectord_monitor() {
   OUTPUT=`$LDIRECTORD status 2>&1`
   case $? in
       0)  return $OCF_SUCCESS
           ;;
       3)  return $OCF_NOT_RUNNING
           ;;
       *)  echo $OUTPUT
           return $OCF_ERR_GENERIC
           ;;
   esac
}

ldirectord_validate() {
       exit $OC_ERR_UNIMPLEMENTED
}

case $__OCF_ACTION in
meta-data)      meta_data
               exit $OCF_SUCCESS
               ;;
start)  ldirectord_start
               ldirectord_exit $?
               ;;
stop)   ldirectord_stop
               ldirectord_exit $?
               ;;
status) ldirectord_status
               ldirectord_exit $?
               ;;
monitor)    ldirectord_monitor
               ldirectord_exit $?
               ;;
validate-all)   ldirectord_validate
               ldirectord_exit $?
               ;;
usage|help)     ldirectord_usage
               exit $OCF_SUCCESS
               ;;
*)              ldirectord_usage
               exit $OCF_ERR_UNIMPLEMENTED
               ;;
esac

#######################################################################


On 11/09/2007, matilda matilda <matilda at grandel.de> wrote:
> >>> "Peter Farrell" <peter.d.farrell at gmail.com> 09/11/07 6:07 PM >>>
> >The only odd thing I didn't find anywhere grep'ing through the lists
> >and Google was the 'WARN: There is something wrong' message in the log
> >files.
> >If you recall the crm_mon said that 'ldirectord start' was failing  -
> >but it wasn't true.
>
> Hi Peter,
>
> use the OCF compliant ressource agent for ldirectord if available
> and try it again.
>
> Best regards
> Andreas Mock
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>



More information about the Linux-HA mailing list