summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/etc-ctdb/rc.local
blob: bc98f72c2b9d580b17344ab2ba811c4250869ac2 (plain)
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
# Hey Emacs, this is a -*- shell-script -*- !!!  :-)

# Use a "service" command in $PATH if one exists.
service ()
{
    if _t=$(which "service" 2>/dev/null) ; then
	"$_t" "$@"
    else
	_nice=""
	_service "$@"
    fi
}

nice_service ()
{
    if _t=$(which "service" 2>/dev/null) ; then
	nice "$_t" "$@"
    else
	_nice="nice"
	_service "$@"
    fi
}

# Always succeeds
set_proc () { : ; }

get_proc ()
{
    case "$1" in
	net/bonding/*)
	    cat "$FAKE_PROC_NET_BONDING/${1##*/}"
	    ;;
	sys/net/ipv4/conf/all/arp_filter)
	    echo 1
	    ;;
	fs/nfsd/threads)
	    echo "$FAKE_NFSD_THREAD_PIDS" | wc -w
	    ;;
	*)
	    echo "get_proc: \"$1\" not implemented"
	    exit 1
    esac
}

# Always succeeds
iptables () { : ; }

CTDB_INIT_STYLE="redhat"
PATH="${EVENTSCRIPTS_PATH}:$PATH"