Hello Jochen,

> ipaddr
> drbd
> filesystem (for mounting drbd)
> apache
> tomcat

find a cib.xml attached. I also attached two resource agents that I
wrote myself and run on Debian Etch. Adapt for your need (hostnames and
ip address). I hope that gets you going.

        Thomas

Attachment: ub-freiburg.xml
Description: XML document

#!/bin/bash 

# . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs

export PID=/var/run/apache2.pid
export EXECUTABLE=/usr/sbin/apache2ctl

case  "$1" in
        start)
                ${EXECUTABLE} start && exit || exit 1;
        ;;

        stop)
                ${EXECUTABLE} stop && exit || exit 1;
        ;;

        status)
                if [ -f "${PID}" ]; then
                        kill -0 `cat ${PID}` &> /dev/null && exit;
                fi

                exit 1;
        ;;

        monitor)
                if [ -f "${PID}" ]; then
                        kill -0 `cat ${PID}` &> /dev/null && {
                                wget -o /dev/null -O /dev/null -T 1 -t 1 
http://localhost/ && exit || exit 1
                        }
                fi

                exit 7;
        ;;

        meta-data)
                cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="apachetg">
        <version>1.0</version>

        <longdesc lang="en">
                OCF Ressource Agent for Apache.
        </longdesc>

        <shortdesc lang="en">OCF Ressource Agent for Apache.</shortdesc>

        <actions>
                <action name="start" timeout="90" />
                <action name="stop" timeout="100" />
                <action name="status" timeout="60" />
                <action name="monitor" depth="0" timeout="30s" interval="10s" 
start-delay="10s" />
                <action name="meta-data" timeout="5s" />
                <action name="validate-all" timeout="20s" />
        </actions>
</resource-agent>
END
        ;;
esac
#!/bin/sh 

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# OCF Ressource Agent on top of tomcat init script shipped with debian. #
#                                  Thomas Glanzmann --tg 21:22 07-12-30 #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

#       This script manages a Heartbeat Tomcat instance
#       usage: $0 {start|stop|status|monitor|meta-data}
#       OCF exit codes are defined via ocf-shellfuncs 

. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs

case  "$1" in
        start)
                /etc/init.d/tomcat5.5 start > /dev/null 2>&1 && exit || exit 1
        ;;

        stop)
                /etc/init.d/tomcat5.5 stop > /dev/null 2>&1 && exit || exit 1
        ;;

        status)
                /etc/init.d/tomcat5.5 status > /dev/null 2>&1 && exit || exit 1
        ;;

        monitor)
                # Check if Ressource is stopped
                /etc/init.d/tomcat5.5 status > /dev/null 2>&1 || exit 7

                # Otherwise check services (XXX: Maybe loosen retry / timeout)
                wget -o /dev/null -O /dev/null -T 1 -t 1 
http://localhost:8180/eccar/ && exit || exit 1
        ;;

        meta-data)
                cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcattg">
<version>1.0</version>

<longdesc lang="en">
OCF Ressource Agent on top of tomcat init script shipped with debian.
</longdesc>

<shortdesc lang="en">OCF Ressource Agent on top of tomcat init script shipped 
with debian.</shortdesc>

<actions>
<action name="start"   timeout="90" />
<action name="stop"    timeout="100" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s" start-delay="10s" 
/>
<action name="meta-data"  timeout="5s" />
<action name="validate-all"  timeout="20s" />
</actions>
</resource-agent>
END
        ;;
esac
_______________________________________________
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