40.vsftpd: reset the fail counter in the "recovered" event.
authorMartin Schwenke <martin@meltin.net>
Mon, 12 Oct 2009 05:17:37 +0000 (16:17 +1100)
committerMartin Schwenke <martin@meltin.net>
Mon, 12 Oct 2009 05:17:37 +0000 (16:17 +1100)
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>
config/events.d/40.vsftpd

index bec786254ae252daf9248d4c50102464420da644..315c150262a6d566621bc01807707c2efc791949 100755 (executable)
@@ -44,9 +44,9 @@ case $cmd in
        [ -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)