tests: Fix calling of ctdb tool from test
[ctdb.git] / config / debug-hung-script.sh
1 #!/bin/sh
2
3 (
4     flock --wait 2 9 || exit 1
5
6     echo "===== Start of hung script debug for PID=\"$1\", event=\"$2\" ====="
7
8     echo "pstree -p -a ${1}:"
9     pstree -p -a $1
10
11     if [ "$2" = "init" ] ; then
12         exit 0
13     fi
14
15     echo "ctdb scriptstatus ${2}:"
16     # No use running several of these in parallel if, say, "releaseip"
17     # event hangs for multiple IPs.  In that case the output would be
18     # interleaved in the log and would just be confusing.
19     ctdb scriptstatus "$2"
20
21     echo "===== End of hung script debug for PID=\"$1\", event=\"$2\" ====="
22
23 ) 9>"${CTDB_VARDIR}/debug-hung-script.lock"