summaryrefslogtreecommitdiffstats
path: root/ctdb/config/events.d/31.clamd
blob: 15751a9c60104f4352ab0fd4410a402951e18d52 (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
50
51
52
#!/bin/sh
# event script to manage clamd in a cluster environment

[ -n "$CTDB_BASE" ] || \
    export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")

. $CTDB_BASE/functions

detect_init_style

case $CTDB_INIT_STYLE in
	redhat)
		service_name="clamd"
		service_config="clamd"
		;;
	*)
		service_name="clamav"
		service_config="clamav"
		;;
esac

service_start ()
{
    service $service_name stop > /dev/null 2>&1
    service $service_name start
}

loadconfig

ctdb_start_stop_service

is_ctdb_managed_service || exit 0

case "$1" in 
    startup)
	ctdb_service_start
        ;;

    shutdown)
        ctdb_service_stop
        ;;

    monitor)
        ctdb_check_unix_socket ${CTDB_CLAMD_SOCKET} || exit $?
        ;;

    *)
	ctdb_standard_event_handler "$@"
	;;
esac

exit 0