Hi,

My version is up to date.
3.0.4-1.el6   

Maybe I'm using old style scripts?. I just followed a google script.

Can you point me to the right direction.

Thanks
Mitsuo

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Thomas Glanzmann
Sent: Friday, June 07, 2013 12:25 AM
To: General Linux-HA mailing list
Subject: Re: [Linux-HA] custom script status)

Hello Mitsuo,
from the output you send, you should update because your heartbeat version
looks very very ancient to me. A resource script for heartbeat always needs
at least these 5 operations:

#!/bin/bash

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

export PID=/var/run/postgrey.pid
export INITSCRIPT=/etc/init.d/postgrey

case  "$1" in
        start)
                ${INITSCRIPT} start &> /dev/null && exit || exit 1;
        ;;

        stop)
                ${INITSCRIPT} stop &> /dev/null && 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 && {
                                exit 0;
                        }
                fi

                exit 7;
        ;;

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

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

        <shortdesc lang="en">OCF Ressource Agent for postgrey.</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

So start should return 0 when the resource was sucesfully started or already
running, otherwise 1.

Stop should return 0 when the resource was sucesfully stoped or already
stopped, otherwise 1.

Status should return 0 if the resource is running, otherwise 1.

Monitor should check if the resource is properly working and return 0 on
success and 7 on failure.

Meta just returns actions and optional paramters and default timeouts
intervals and monitoring delays.

Cheers,
        Thomas
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

_______________________________________________
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