1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/ctdb/config/events.d/40.vsftpd
Ronnie Sahlberg 96a12cc4ab add a simple events script to manage vsftpd
(This used to be ctdb commit 413efc7af529e4ebda6f7ea6e36f79ba72a2d1d9)
2007-06-05 18:14:01 +10:00

46 lines
839 B
Bash
Executable File

#!/bin/sh
# event strict to manage vsftpd in a cluster environment
. /etc/ctdb/functions
loadconfig vsftpd
[ "$CTDB_MANAGES_VSFTPD" = "yes" ] || exit 0
cmd="$1"
shift
case $cmd in
startup)
/bin/mkdir -p /etc/ctdb/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" >> /etc/ctdb/state/vsftpd/restart
;;
releaseip)
echo "restart" >> /etc/ctdb/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 /etc/ctdb/state/vsftpd/restart ] && {
service vsftpd stop > /dev/null 2>&1
service vsftpd start
} >/dev/null 2>&1
/bin/rm -f /etc/ctdb/state/vsftpd/restart
;;
esac
exit 0