1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/ctdb/config/debug-hung-script.sh
Martin Schwenke 98163e01a9 scripts: Do not run ctdb tool commands when debugging hung "init" event
CTDB daemon is not ready to accept clients in INIT runstate (init event).
CTDB daemon will start accepting connections in SETUP runstate (setup event)
and later.

Also, minor log formatting changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 81d7ce03b28d592a1337639e14d9ea141e20bfff)
2013-08-09 11:04:55 +10:00

24 lines
608 B
Bash
Executable File

#!/bin/sh
(
flock --wait 2 9 || exit 1
echo "===== Start of hung script debug for PID=\"$1\", event=\"$2\" ====="
echo "pstree -p -a ${1}:"
pstree -p -a $1
if [ "$2" = "init" ] ; then
exit 0
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"