1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

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>
This commit is contained in:
Martin Schwenke 2014-06-26 14:46:54 +10:00 committed by Amitay Isaacs
parent d70c1e41ec
commit b0c191e5de

View File

@ -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"