eventscripts: Make the early exit in 01.reclock earlier
authorMartin Schwenke <martin@meltin.net>
Tue, 30 Apr 2013 05:16:44 +0000 (15:16 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 6 May 2013 06:24:58 +0000 (16:24 +1000)
That way we don't even check the counter...

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

index a3bfc66c1d5e2a06345670231e7a2632b3cf054e..676d475ff57fb1f17e79c902247c23b980f28a2d 100755 (executable)
@@ -15,6 +15,9 @@ case "$1" in
     monitor)
        RECLOCKFILE=$(ctdb -Y getreclock)
 
+       # Early exit if not using a reclock file
+       [ -n "$RECLOCKFILE" ] || exit 0
+
        ctdb_counter_incr
        (ctdb_check_counter_limit 200 >/dev/null 2>&1) || {
            echo "Reclock file $RECLOCKFILE\" can not be accessed. Shutting down."
@@ -23,12 +26,6 @@ case "$1" in
            ctdb shutdown
        }
 
-       [ -z "$RECLOCKFILE" ] && {
-           # we are not using a reclock file
-           ctdb_counter_init
-           exit 0
-       }
-
        # try stat the reclock file as a background process
        # so that we dont block in case the cluster filesystem is unavailable
        (