ethtool does not support virtio_net devices.
[Samba.git] / ctdb / config / events.d / 01.reclock
blob345a63150ffe14be4fbecb9c3f13fd7c7d4d9d3c
1 #!/bin/sh
2 # script to check accessibility to the reclock file on a node
4 . $CTDB_BASE/functions
5 loadconfig
7 case "$1" in
8 init)
9 ctdb_counter_init
12 monitor)
13 RECLOCKFILE=$(ctdb -Y getreclock)
15 ctdb_counter_incr
16 (ctdb_check_counter_limit 200 >/dev/null 2>&1) || {
17 echo "Reclock file $RECLOCKFILE\" can not be accessed. Shutting down."
19 sleep 1
20 ctdb shutdown
23 [ -z "$RECLOCKFILE" ] && {
24 # we are not using a reclock file
25 ctdb_counter_init
26 exit 0
29 # try stat the reclock file as a background process
30 # so that we dont block in case the cluster filesystem is unavailable
32 stat $RECLOCKFILE && {
33 # we could stat the file, reset the counter
34 ctdb_counter_init
36 ) >/dev/null 2>/dev/null &
38 ctdb_check_counter_limit 3 quiet
42 ctdb_standard_event_handler "$@"
44 esac
46 exit 0