The logic in the monitor event itself is very complex. Nearly all of
it can go away by adding a single check of
$CTDB_PARTIALLY_ONLINE_INTERFACES to the return logic of
monitor_interfaces() and reversing the sense of the corresponding
check.
Signed-off-by: Martin Schwenke <martin@meltin.net>
$fail || return 0
- $up_interfaces_found && return 2
+ $up_interfaces_found && \
+ [ "$CTDB_PARTIALLY_ONLINE_INTERFACES" = "yes" ] && \
+ return 0
return 1
}
;;
monitor)
- monitor_interfaces
- ret=$?
-
- test x"$ret" = x"2" && {
- test x"$CTDB_PARTIALLY_ONLINE_INTERFACES" != x"yes" && {
- exit 1;
- }
- # as long as we have one interface available don't become
- # unhealthy
- ret=0
- }
-
- test x"$ret" != x"0" && {
- exit 1;
- }
+ monitor_interfaces || exit 1
;;
*)
ctdb_standard_event_handler "$@"