/etc/ha.d/resource.d/hto-mapfuncs is in heartbeat 1:3.0.5-3ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #!/bin/sh
#
# Author: Zhao Kai <zhaokai@cn.ibm.com>
#
# License: GNU General Public License (GPL)
# Support: linux-ha@lists.linux-ha.org
#
#set -x
. /etc/ha.d/shellfuncs
OCF_ROOT_DIR=/usr/lib/ocf
OCF_RA_DIR=/usr/lib/ocf/resource.d/
OCF_RA_VERSION_MAJOR=1 ; export OCF_RA_VERSION_MAJOR
OCF_RA_VERSION_MINOR=0 ; export OCF_RA_VERSION_MINOR
OCF_ROOT=$OCF_ROOT_DIR ; export OCF_ROOT
LEGAL_ACTIONS="(start|stop|status|usage|meta-data)"
log_and_print(){
ha_log "$*"
echo "$*"
}
#
# rsc_id=rsc1 rsc_type=IPaddr2 provide=heartbeat start ip=192.168.0.1 .....
#
ra_execocf(){
if [ "x${1}" = "x" ]; then
log_and_print "ERROR: No action specfied."
usage
exit 1
fi
. ${OCF_RA_DIR}/heartbeat/.ocf-shellfuncs
__ACTION=$1
__SCRIPT_NAME="${OCF_RA_DIR}/heartbeat/${OCF_TYPE}"
if [ "x${OCF_TYPE}" = "x" ]; then
log_and_print "ERROR: Internal error. No value for OCF_TYPE specified"
exit 1
fi
if [ ! -x $__SCRIPT_NAME ]
then
log_and_print "ERROR: $__SCRIPT_NAME is not an executable file "
exit 1
fi
# execute ocf ra and get return value
case $__ACTION in
start) $__SCRIPT_NAME start;;
stop) $__SCRIPT_NAME stop ;;
monitor) $__SCRIPT_NAME monitor;;
status) $__SCRIPT_NAME monitor;; # Mapping this to monitor is a bug
usage|help) usage;;
*) log_and_print "ERROR: Unknown operation: $__ACTION"
usage
exit 1;;
esac
ocf_return_status=$?
case $ocf_return_status in
$OCF_SUCCESS)
case $__ACTION in
monitor|status) log_and_print "INFO: $rsc_type Running OK";;
*) log_and_print "INFO: $rsc_type Success";;
esac;;
$OCF_ERR_GENERIC)
log_and_print "ERROR: $rsc_type Generic error";;
$OCF_ERR_ARGS)
log_and_print "ERROR: $rsc_type Illegal argument";;
$OCF_ERR_UNIMPLEMENTED)
log_and_print "ERROR: $rsc_type Function unimplemented";;
$OCF_ERR_PERM)
log_and_print "ERROR: $rsc_type User had insufficient privilege";;
$OCF_ERR_INSTALLED)
log_and_print "ERROR: $rsc_type Program is not installed";;
$OCF_ERR_CONFIGURED)
log_and_print "ERROR: $rsc_type Program is not configured";;
$OCF_NOT_RUNNING)
log_and_print "INFO: $rsc_type Resource is stopped";;
*)
log_and_print "ERROR: $rsc_type Unknown error: $ocf_return_status"
exit 1
;;
esac
return $ocf_return_status
}
|