]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
stop.sh: do not try to contact mon unless cluster is up
authorKefu Chai <kchai@redhat.com>
Tue, 17 Dec 2019 11:48:45 +0000 (19:48 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 17 Dec 2019 12:11:28 +0000 (20:11 +0800)
otherwise "ceph mon metadata" will hang, when we try to stop an
already-stopped cluster. and `vstart_runner.py` always calls `stop.sh`
before setting up a cluster.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/stop.sh

index 0a71752d1d4b9acc93fbeb41f2adcda0ffd59b4f..604255f4ae84deb9fc5347ff46f73810494bbc89 100755 (executable)
@@ -114,8 +114,10 @@ while [ $# -ge 1 ]; do
 done
 
 if [ $stop_all -eq 1 ]; then
-    #Umount mounted filesystems from vstart cluster
-    do_umountall
+    if "${CEPH_BIN}"/ceph -s --connect-timeout 1 -c $conf_fn >/dev/null 2>&1; then
+        # Umount mounted filesystems from vstart cluster
+        do_umountall
+    fi
 
     if "${CEPH_BIN}"/rbd device list -c $conf_fn >/dev/null 2>&1; then
         "${CEPH_BIN}"/rbd device list -c $conf_fn | tail -n +2 |