/etc/ctdb/events.d/40.vsftpd is in ctdb 1.12+git20120201-5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 53 54 55 56 57 58 59 | #!/bin/sh
# event strict to manage vsftpd in a cluster environment
. $CTDB_BASE/functions
service_name="vsftpd"
# make sure the service is stopped first
service_start ()
{
service $service_name stop > /dev/null 2>&1
service $service_name start
}
service_stop ()
{
service $service_name stop
}
service_fail_limit=2
service_tcp_ports=21
loadconfig
ctdb_start_stop_service
is_ctdb_managed_service || exit 0
ctdb_service_check_reconfigure
case "$1" in
startup)
ctdb_service_start
;;
shutdown)
ctdb_service_stop
;;
takeip|releaseip)
ctdb_service_set_reconfigure
;;
monitor)
if [ -n "$service_tcp_ports" ] ; then
if ctdb_check_tcp_ports $service_tcp_ports ; then
ctdb_counter_init
else
ctdb_counter_incr
ctdb_check_counter_limit
exit 0 # only count 1 failure per monitor event
fi
fi
;;
*)
ctdb_standard_event_handler "$@"
;;
esac
exit 0
|