Each recovery that involves IP reassignments results in a restart of
vsftpd in the "recovered" event. Currently, we can have several
recoveries in quick succession and the "monitor" event following each
can fail because vsftpd isn't ready yet. This results in cumulative
failures, so the node is marked unhealthy, even though vsftpd has
never had a proper opportunity to become ready.
This resets the fail count after each recovery.
While we're here, also move the delete of the restart flag file into
the body of the conditional.
Signed-off-by: Martin Schwenke <martin@meltin.net>
[ -f $CTDB_BASE/state/vsftpd/restart ] && {
service vsftpd stop > /dev/null 2>&1
service vsftpd start
+ /bin/rm -f $CTDB_BASE/state/vsftpd/restart 2>/dev/null
+ ctdb_counter_init "$VSFTPD_FAILS"
} >/dev/null 2>&1
-
- /bin/rm -f $CTDB_BASE/state/vsftpd/restart 2>/dev/null
;;
monitor)