diff --git a/heartbeat/.ocf-binaries.in b/heartbeat/.ocf-binaries.in index 3567cc23b..2f89c40f3 100644 --- a/heartbeat/.ocf-binaries.in +++ b/heartbeat/.ocf-binaries.in @@ -1,68 +1,76 @@ # Make sure PATH contains all the usual suspects export PATH="$PATH:/sbin:/bin:/usr/sbin:/usr/bin" # Include /usr/ucb for finding whoami on Solaris export PATH="$PATH:/usr/ucb" # Binaries and binary options for use in Resource Agents : ${AWK:=@AWK@} : ${EGREP:="@EGREP@"} : ${IFCONFIG_A_OPT:="@IFCONFIG_A_OPT@"} : ${MAILCMD:=@MAILCMD@} : ${MKTEMP:=@MKTEMP@} : ${PING:=@PING@} : ${RPM:=@RPM@} : ${SH:=@SHELL@} : ${TEST:=@TEST@} : ${TESTPROG:=@TEST@} # Entries that should probably be removed : ${BASENAME:=basename} : ${BLOCKDEV:=blockdev} : ${CAT:=cat} : ${FSCK:=fsck} : ${FUSER:=fuser} : ${GETENT:=getent} : ${GREP:=grep} : ${IFCONFIG:=ifconfig} : ${IPTABLES:=iptables} : ${IP2UTIL:=ip} : ${MDADM:=mdadm} : ${MODPROBE:=modprobe} : ${MOUNT:=mount} : ${MSGFMT:=msgfmt} : ${NETSTAT:=netstat} : ${PERL:=perl} : ${PYTHON:=python} : ${RAIDSTART:=raidstart} : ${RAIDSTOP:=raidstop} : ${ROUTE:=route} : ${UMOUNT:=umount} : ${REBOOT:=reboot} : ${POWEROFF_CMD:=poweroff} : ${WGET:=wget} : ${WHOAMI:=whoami} : ${STRINGSCMD:=strings)} : ${SCP:=scp} : ${SSH:=ssh} : ${SWIG:=swig} : ${MKTEMP:=mktemp} : ${GZIP_PROG:=gzip} : ${TAR:=tar} : ${MD5:=md5} : ${DRBDADM:=drbdadm} : ${DRBDSETUP:=drbdsetup} check_binary () { - if [ ! -x "`which $1`" ] ; then - ocf_log err "Setup problem: Couldn't find utility $1" + if + ! have_binary "$1" + then + if [ $OCF_NOT_RUNNING = 7 ]; then + # Chances are we have a fully setup OCF environment + ocf_log err "Setup problem: Couldn't find utility $1" + else + echo "Setup problem: Couldn't find utility $1" + fi exit $OCF_ERR_INSTALLED fi } have_binary () { - if [ ! -x "`which $1`" ] ; then + bin=`echo $1 | sed -e 's/ -.*//'` + if [ -x "`which $bin`" ] ; then return 0 fi return 1 }