40.vsftpd monitor event only fails after 2 failures to connect to port 21.
authorMartin Schwenke <martin@meltin.net>
Wed, 30 Sep 2009 11:05:16 +0000 (21:05 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 30 Sep 2009 11:05:16 +0000 (21:05 +1000)
commitcfe63636a163730ae9ad3554b78519b3c07d8896
tree9043a3b3c5a4147543357243ef6ce582ea9aaf0d
parent803cfb4cd2f6d139f466053a6d7e104fcb772ef5
40.vsftpd monitor event only fails after 2 failures to connect to port 21.

Change the monitor event in 40.vsftpd so it only fails if there are 2
successive failures connecting to port 21.  This reduces the
likelihood of unhealthy nodes due to vsftpd being restarted for
reconfiguration due to node failover or system reconfiguration.

New eventscript functions ctdb_counter_init, ctdb_counter_incr,
ctdb_counter_limit.  These are used to count arbitrary things in
eventscripts, depending on the eventscript name and a tag that is
passed, and determine if a specified limit has been hit.  They're good
for counting failures!

These functions are used in 40.vsftpd and also in 01.reclock - the
latter used to do the counting without these functions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/01.reclock
config/events.d/40.vsftpd
config/functions