scripts: Do not run ctdb tool commands when debugging hung "init" event
authorMartin Schwenke <martin@meltin.net>
Tue, 6 Aug 2013 06:11:40 +0000 (16:11 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 9 Aug 2013 01:04:55 +0000 (11:04 +1000)
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>
config/debug-hung-script.sh

index 32dbd5f863a492ea85e5412f116861da5e359006..198424241885fb1a3481ba7b6136d0d18e73b570 100755 (executable)
@@ -3,17 +3,21 @@
 (
     flock --wait 2 9 || exit 1
 
-    echo "===== Start of hung script debug for PID=\"$1\", event\"$2\" ====="
+    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\" ====="
+    echo "===== End of hung script debug for PID=\"$1\", event=\"$2\" ====="
 
 ) 9>"${CTDB_VARDIR}/debug-hung-script.lock"