File: ocf-binaries.in

package info (click to toggle)
resource-agents 1%3A4.0.0~rc1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,644 kB
  • ctags: 2,191
  • sloc: sh: 47,713; ansic: 4,074; perl: 3,457; makefile: 663; xml: 89
file content (74 lines) | stat: -rw-r--r-- 1,613 bytes parent folder | download | duplicates (2)
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
# Make sure PATH contains all the usual suspects
PATH="$PATH:/sbin:/bin:/usr/sbin:/usr/bin"

# Include /usr/ucb for finding whoami on Solaris
PATH="$PATH:/usr/ucb"

export PATH

# Binaries and binary options for use in Resource Agents
: ${AWK:=@AWK@}
: ${EGREP:="@EGREP@"}
: ${IFCONFIG_A_OPT:="@IFCONFIG_A_OPT@"}
: ${MAILCMD:=@MAILCMD@}
: ${PING:=@PING@}
: ${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}
: ${GZIP_PROG:=gzip}
: ${TAR:=tar}
: ${MD5:=md5}
: ${DRBDADM:=drbdadm}
: ${DRBDSETUP:=drbdsetup}

check_binary () {
    if ! have_binary "$1"; then
	if [ "$OCF_NOT_RUNNING" = 7 ]; then
	    # Chances are we have a fully setup OCF environment
	    ocf_exit_reason "Setup problem: couldn't find command: $1"
	else 
	    echo "Setup problem: couldn't find command: $1"
	fi
	exit $OCF_ERR_INSTALLED
    fi
}

have_binary () {
    if [ "$OCF_TESTER_FAIL_HAVE_BINARY" = "1" ]; then
    	false
    else
	local bin=`echo $1 | sed -e 's/ -.*//'`
	test -x "`which $bin 2>/dev/null`"
    fi
}