summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-05-25 12:10:29 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-05-25 12:10:29 +1000
commite999ade7bb1a1e5e1e84f3eb125ec8c359aaa5aa (patch)
tree94c5987a86e332b3df5bc091bcf99b92ca826961 /ctdb
parent691379b13df45215c6bc0c05aa1b90de8c506725 (diff)
downloadsamba-e999ade7bb1a1e5e1e84f3eb125ec8c359aaa5aa.tar.gz
samba-e999ade7bb1a1e5e1e84f3eb125ec8c359aaa5aa.tar.xz
samba-e999ade7bb1a1e5e1e84f3eb125ec8c359aaa5aa.zip
From Flavio Carmo Junior <carmo.flavio@gmail.com>
Add an eventscript to manage ClamAV (This used to be ctdb commit bb4ef6c4d2bc3578bdf4432517e98f85ec94e3b6)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/config/events.d/31.clamd53
1 files changed, 53 insertions, 0 deletions
diff --git a/ctdb/config/events.d/31.clamd b/ctdb/config/events.d/31.clamd
new file mode 100644
index 0000000000..11238b7465
--- /dev/null
+++ b/ctdb/config/events.d/31.clamd
@@ -0,0 +1,53 @@
+#!/bin/sh
+# event script to manage clamd in a cluster environment
+
+. $CTDB_BASE/functions
+loadconfig ctdb
+
+detect_init_style
+
+case $CTDB_INIT_STYLE in
+ redhat)
+ CTDB_SERVICE_CLAMD="clamd"
+ CTDB_CONFIG_CLAMD="clamd"
+ ;;
+ suse)
+ CTDB_SERVICE_CLAMD="clamav"
+ CTDB_CONFIG_CLAMD="clamav"
+ ;;
+ ubuntu)
+ CTDB_SERVICE_CLAMD="clamav"
+ CTDB_CONFIG_CLAMD="clamav"
+ ;;
+ *)
+ # should not happen.
+ # for now use red hat style as default
+ CTDB_SERVICE_CLAMD="clamd"
+ CTDB_CONFIG_CLAMD="clamd"
+ ;;
+esac
+
+loadconfig "${CTDB_CONFIG_CLAMD}"
+
+[ "$CTDB_MANAGES_CLAMD" = "yes" ] || exit 0
+
+cmd="$1"
+shift
+
+case $cmd in
+ startup)
+ service "${CTDB_SERVICE_CLAMD}" stop > /dev/null 2>&1
+ service "${CTDB_SERVICE_CLAMD}" start
+ ;;
+
+ shutdown)
+ service "${CTDB_SERVICE_CLAMD}" stop
+ ;;
+
+ monitor)
+ ctdb_check_unix_socket "clamd" ${CTDB_CLAMD_SOCKET}
+ ;;
+esac
+
+exit 0
+