ctdb-tests: Avoid shutdown error when daemon already cleanly shut down
authorMartin Schwenke <martin@meltin.net>
Mon, 17 Feb 2020 05:29:05 +0000 (16:29 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 18 Feb 2020 02:56:38 +0000 (02:56 +0000)
This depends on a small amount of internal knowledge but is the
cleanest way of avoiding errors for nodes that have already been shut
down.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/local_daemons.sh

index e9f9423cb0c1e8f2f9b07eddfb74bbfee9072fa1..a67055a9337bb0bf2ab4958e273b5be0814d6929 100755 (executable)
@@ -367,7 +367,10 @@ local_daemons_stop ()
 
        onnode_common
 
-       onnode -p "$_nodes" "${CTDB:-${VALGRIND:-} ctdb} shutdown"
+       onnode -p "$_nodes" \
+               "if [ -e \"\${CTDB_BASE}/run/ctdbd.pid\" ] ; then \
+                       ${CTDB:-${VALGRIND:-} ctdb} shutdown ; \
+                fi"
 }
 
 local_daemons_onnode_usage ()