2 # event strict to manage vsftpd in a cluster environment
4 [ -n "$CTDB_BASE" ] || \
5 CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
7 . "${CTDB_BASE}/functions"
11 service_reconfigure ()
13 service $service_name restart
18 ctdb_setup_state_dir "service" "$service_name"
20 [ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
24 service "$service_name" stop > /dev/null 2>&1
25 service "$service_name" start
30 service "$service_name" stop
34 ctdb_service_set_reconfigure
38 if ctdb_service_needs_reconfigure ; then
39 ctdb_service_reconfigure
44 if ctdb_check_tcp_ports 21 ; then
48 num_fails=$(ctdb_counter_get)
49 if [ "$num_fails" -ge 2 ] ; then
50 die "ERROR: ${num_fails} consecutive failures for vsftpd, marking node unhealthy"
51 elif [ "$num_fails" -eq 1 ] ; then
52 echo "WARNING: vsftpd not listening but less than 2 consecutive failures, not unhealthy yet"