summaryrefslogtreecommitdiffstats
path: root/ctdb/config
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-06-26 14:46:54 +1000
committerAmitay Isaacs <amitay@samba.org>2014-07-03 05:55:13 +0200
commitb0c191e5de15e54646b02925e37458d6a56db015 (patch)
treefe3e83434ec22e4f8e2568b1ef3fa96b9b861676 /ctdb/config
parentd70c1e41ec0afeab9112d6d2da3da03be91624bc (diff)
downloadsamba-b0c191e5de15e54646b02925e37458d6a56db015.tar.gz
samba-b0c191e5de15e54646b02925e37458d6a56db015.tar.xz
samba-b0c191e5de15e54646b02925e37458d6a56db015.zip
ctdb-scripts: Always print footer when debugging hung script
There shouldn't be an early exit for the "init" event. Just make the "ctdb scriptstatus" call conditional. While here, move the comment about only running a single instance to be near locking code. The comment is more useful there. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config')
-rwxr-xr-xctdb/config/debug-hung-script.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/ctdb/config/debug-hung-script.sh b/ctdb/config/debug-hung-script.sh
index 63d695f01b..f353b7d4bc 100755
--- a/ctdb/config/debug-hung-script.sh
+++ b/ctdb/config/debug-hung-script.sh
@@ -13,6 +13,9 @@ if [ -n "$CTDB_DEBUG_HUNG_SCRIPT_LOGFILE" ] ; then
fi
(
+ # No use running several of these in parallel if, say, "releaseip"
+ # event hangs for multiple IPs. In that case the output would be
+ # interleaved in the log and would just be confusing.
flock --wait 2 9 || exit 1
echo "===== Start of hung script debug for PID=\"$1\", event=\"$2\" ====="
@@ -38,16 +41,11 @@ fi
fi
done
- if [ "$2" = "init" ] ; then
- exit 0
+ if [ "$2" != "init" ] ; then
+ echo "---- ctdb scriptstatus ${2}: ----"
+ ctdb scriptstatus "$2"
fi
- echo "---- ctdb scriptstatus ${2}: ----"
- # No use running several of these in parallel if, say, "releaseip"
- # event hangs for multiple IPs. In that case the output would be
- # interleaved in the log and would just be confusing.
- ctdb scriptstatus "$2"
-
echo "===== End of hung script debug for PID=\"$1\", event=\"$2\" ====="
) 9>"${CTDB_VARDIR}/debug-hung-script.lock"