This makes the logic more obvious.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
service $service_name restart
}
-service_fail_limit=2
-
loadconfig
ctdb_start_stop_service
ctdb_counter_init
else
ctdb_counter_incr
- ctdb_check_counter
- ctdb_check_counter "quiet" -ge 1 || \
- echo "WARNING: vsftpd not listening but less than $service_fail_limit consecutive failures, not unhealthy yet"
+ num_fails=$(ctdb_counter_get)
+ if [ "$num_fails" -ge 2 ] ; then
+ die "ERROR: ${num_fails} consecutive failures for vsftpd, marking node unhealthy"
+ elif [ "$num_fails" -eq 1 ] ; then
+ echo "WARNING: vsftpd not listening but less than 2 consecutive failures, not unhealthy yet"
+ fi
fi
;;
esac