ctdb-scripts: Add an early exit to statd-callout's notify case
authorMartin Schwenke <martin@meltin.net>
Tue, 19 Nov 2013 04:40:08 +0000 (15:40 +1100)
committerMichael Adam <obnox@samba.org>
Wed, 27 Nov 2013 17:46:16 +0000 (18:46 +0100)
If $statd_state is empty then the loop will run once and print
spurious errors.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
ctdb/config/statd-callout

index 70665e2b33ba67ac2653df1ae7d7c17c56ad226f..53b408d55447d18408a8c4e87686ce5924328ac4 100755 (executable)
@@ -148,6 +148,7 @@ case "$1" in
            awk -v pnn=$pnn 'pnn == $2 { printf "s/^key.*=.*statd-state@\\(%s\\)@\\([^\"]*\\).*/\\1 \\2/p\n", gensub(/\./, "\\\\.", "g", $1) }')
 
        statd_state=$(ctdb catdb ctdb.tdb | sed -n "$sed_expr" | sort)
+       [ -n "$statd_state" ] || exit 0
 
        # The following is dangerous if this script times out before
        # all of the smnotify commands are run.  Revert to individual