]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
vstart.sh: fix ceph random port check
authorChangcheng Liu <changcheng.liu@intel.com>
Wed, 6 Mar 2019 08:11:31 +0000 (16:11 +0800)
committerChangcheng Liu <changcheng.liu@intel.com>
Mon, 8 Apr 2019 04:51:49 +0000 (12:51 +0800)
The regular expression should check the port first, then
check "LISTEN" item. "LISTEN" is not after the port item.

Signed-off-by: Changcheng Liu <changcheng.liu@intel.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/vstart.sh

index 1b0dfe8a6b0f5e61adaca76d70e97112e99d385b..417b478b901c9af1aedc379f223fbda99bf12b8c 100755 (executable)
@@ -941,7 +941,7 @@ then
   while [ true ]
   do
     CEPH_PORT="$(echo $(( RANDOM % 1000 + 40000 )))"
-    ss -a -n | egrep ":${CEPH_PORT} .+LISTEN" 1>/dev/null 2>&1 || break
+    ss -a -n | egrep "\<LISTEN\>.+:${CEPH_PORT}\s+" 1>/dev/null 2>&1 || break
   done
 fi