#!/bin/sh # # Description: Control services under daemontools # # Author: Philip Gwyn # Support: philip@awale.qc.ca # License: GNU General Public License (GPL) # Copyright: (C) 2007 Philp Gwyn / Awalé. # # usage: ./daemontool [ []] # {start|stop|status|restart} # daemontool::[::[::] # # : the name of the service's sub-directory # : Time (in seconds) to let the process start # # # set -x . /etc/ha.d/resource.d/hto-mapfuncs usage() { echo "usage: $0 [ []] $LEGAL_ACTIONS" exit 1 } # Check the arguments passed to this script if [ $# -lt 1 ]; then usage fi if [ $# -gt 4 ]; then usage fi if [ "x$2" != "x" ]; then OCF_RESKEY_service="$1"; shift export OCF_RESKEY_service fi if [ "x$2" != "x" ]; then OCF_RESKEY_delay="$1"; shift export OCF_RESKEY_delay fi if [ "x$2" != "x" ]; then OCF_RESKEY_process="$1"; shift export OCF_RESKEY_process fi OCF_TYPE=daemontools OCF_RESOURCE_INSTANCE=${OCF_TYPE}_$OCF_RESKEY_service export OCF_TYPE OCF_RESOURCE_INSTANCE rsc_type=${rsc_type:-daemontools} export rsc_type ra_execocf $1