1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/ctdb/config/events/legacy/31.clamd.script
Martin Schwenke e081cafc9c ctdb-scripts: Drop event script CTDB_MANAGED_<service> variables
Enable required event scripts to manage services.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-07-11 11:48:39 +02:00

38 lines
578 B
Bash
Executable File

#!/bin/sh
# event script to manage clamd in a cluster environment
[ -n "$CTDB_BASE" ] || \
CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
. "${CTDB_BASE}/functions"
detect_init_style
case $CTDB_INIT_STYLE in
redhat)
service_name="clamd"
;;
*)
service_name="clamav"
;;
esac
load_script_options
case "$1" in
startup)
service "$service_name" stop > /dev/null 2>&1
service "$service_name" start || exit $?
;;
shutdown)
service "$service_name"_stop
;;
monitor)
ctdb_check_unix_socket "$CTDB_CLAMD_SOCKET" || exit $?
;;
esac
exit 0