1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00
Ronnie Sahlberg 9f4b0dab03 only check port 21 when monitoring vsftpd
(This used to be ctdb commit 41b0d71aaee186138eddc97d49503841fa26f234)
2007-11-15 06:56:02 +11:00

50 lines
895 B
Bash
Executable File

#!/bin/sh
# event strict to manage vsftpd in a cluster environment
. $CTDB_BASE/functions
loadconfig vsftpd
[ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
cmd="$1"
shift
case $cmd in
startup)
/bin/mkdir -p $CTDB_BASE/state/vsftpd
# make sure the service is stopped first
service vsftpd stop > /dev/null 2>&1
service vsftpd start
;;
shutdown)
service vsftpd stop
;;
takeip)
echo "restart" >> $CTDB_BASE/state/vsftpd/restart
;;
releaseip)
echo "restart" >> $CTDB_BASE/state/vsftpd/restart
;;
recovered)
# if we have taken or released any ips we must
# restart vsftpd to ensure that all tcp connections are reset
[ -f $CTDB_BASE/state/vsftpd/restart ] && {
service vsftpd stop > /dev/null 2>&1
service vsftpd start
} >/dev/null 2>&1
/bin/rm -f $CTDB_BASE/state/vsftpd/restart
;;
monitor)
ctdb_check_tcp_ports "ftp" 21
;;
esac
exit 0