I wouldn't say that this is a Heartbeat script. This is an LSB script,
but not OCF.

On 7/28/06, Rajat Upadhyaya <[EMAIL PROTECTED]> wrote:
This is the Heartbeat resource script for Pure-FTPd.

This takes 3 arguments
1) the Pure-FTPd Perl/Python script which parses the Pure-FTPd
configuration file (full path)
2) the Pure-FTPd configuration file itself (full path again).
3) start | stop | status


--------------------------

File : Pure-FTPd

#!/bin/bash
#
# This script is a Heartbeat resource script for using Pure-FTPd
# in an Active-Passive setup.
#
# Based on the script by Philipp Reisner (Jan 2003).
# Modified for Pure-FTPd by Rajat Upadhyaya (July 2006)
#
###


if [ "$#" -eq 3 ];
then
       SCRIPT="$1"
       CONF_FILE="$2"
       CMD="$3"
else
       CMD="usage"
fi

case "$CMD" in
   start)
       # try several times, in case heartbeat deadtime
       # was smaller than drbd ping time
       try=6
       while true; do
               $SCRIPT $CONF_FILE && break
               let "--try" || exit 20
               sleep 1
       done
       ;;

   stop)
       pgrep pure-ftpd >> /dev/null
       if [ $? -eq 0 ] ; then
               pkill pure-ftpd
       fi
       ;;

   status)
               pgrep pure-ftpd >> /dev/null
       if [ $? -eq 0 ]; then
           echo "Pure-FTPd is running"
       else
           echo "Pure-FTPd is stopped"
       fi
       ;;

   *)
       echo "Usage: Pure-FTPd <script> <configuration file>
{start|stop|status}"
       echo ""
       echo "Note that both <script> and <configuration file> are the
full paths"
               echo "to the respective files"
       exit 1
       ;;
esac

exit 0

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to