mirror of
https://github.com/samba-team/samba.git
synced 2025-03-26 18:50:30 +03:00
Eventscripts: 10.interfaces clean-ups - push logic into monitor_interfaces().
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> (This used to be ctdb commit fa93177442c65c2a4eb2d5d5dba0a0da1c486969)
This commit is contained in:
parent
00c4cc6d22
commit
6fa27bdf18
@ -111,7 +111,9 @@ monitor_interfaces()
|
||||
|
||||
$fail || return 0
|
||||
|
||||
$up_interfaces_found && return 2
|
||||
$up_interfaces_found && \
|
||||
[ "$CTDB_PARTIALLY_ONLINE_INTERFACES" = "yes" ] && \
|
||||
return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
@ -270,21 +272,7 @@ case "$1" in
|
||||
;;
|
||||
|
||||
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 "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user