From d19db0af84d1440a9287d43a94f82289b5092ef3 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Wed, 6 Mar 2019 16:11:31 +0800 Subject: [PATCH] vstart.sh: fix ceph random port check The regular expression should check the port first, then check "LISTEN" item. "LISTEN" is not after the port item. Signed-off-by: Changcheng Liu Signed-off-by: Kefu Chai --- src/vstart.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vstart.sh b/src/vstart.sh index 1b0dfe8a6b0..417b478b901 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -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 "\.+:${CEPH_PORT}\s+" 1>/dev/null 2>&1 || break done fi -- 2.39.5