PageRenderTime 112ms CodeModel.GetById 107ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/ctdb/events.d/31.clamd

http://github.com/brinkman83/bashrc
Shell | 46 lines | 32 code | 12 blank | 2 comment | 2 complexity | d81a7ba56243753076585645e9cdcf66 MD5 | raw file
 1#!/bin/sh
 2# event script to manage clamd in a cluster environment
 3
 4. $CTDB_BASE/functions
 5
 6detect_init_style
 7
 8case $CTDB_INIT_STYLE in
 9	redhat)
10		service_name="clamd"
11		service_config="clamd"
12		;;
13	*)
14		service_name="clamav"
15		service_config="clamav"
16		;;
17esac
18
19service_start="service $service_name stop > /dev/null 2>&1 ; service $service_name start"
20service_stop="service $service_name stop"
21
22loadconfig
23
24ctdb_start_stop_service
25
26is_ctdb_managed_service || exit 0
27
28case "$1" in 
29    startup)
30	ctdb_service_start
31        ;;
32
33    shutdown)
34        ctdb_service_stop
35        ;;
36
37    monitor)
38        ctdb_check_unix_socket ${CTDB_CLAMD_SOCKET} || exit $?
39        ;;
40
41    *)
42	ctdb_standard_event_handler "$@"
43	;;
44esac
45
46exit 0