]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: drop .ceph_port and use randomly selected available port 19268/head
authorShinobu Kinjo <shinobu@redhat.com>
Fri, 1 Dec 2017 02:05:57 +0000 (11:05 +0900)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 1 Dec 2017 03:16:06 +0000 (12:16 +0900)
vstart.sh becomes independent of do_cmake.sh

Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
do_cmake.sh
src/vstart.sh

index b8e092d1332cfbdc6d581b91838d306b937d8fbb..084194c4b8420303f1ff448647d22fbd15da93a8 100755 (executable)
@@ -22,7 +22,4 @@ plugin dir = lib
 erasure code dir = lib
 EOF
 
-# give vstart a (hopefully) unique mon port to start with
-echo $(( RANDOM % 1000 + 40000 )) > .ceph_port
-
 echo done.
index 55b10e91895140565e692796479462991e893a6c..0ceef3eda22ba9550147991e98b854e6d80ea5c8 100755 (executable)
@@ -805,9 +805,13 @@ if [ -n "$MON_ADDR" ]; then
        CMDS_ARGS=" -m "$MON_ADDR
 fi
 
-if [ -z "$CEPH_PORT" ]; then
-    CEPH_PORT=6789
-    [ -e ".ceph_port" ] && CEPH_PORT=`cat .ceph_port`
+if [ -z "$CEPH_PORT" ]
+then
+  while [ true ]
+  do
+    CEPH_PORT="$(echo $(( RANDOM % 1000 + 40000 )))"
+    ss -a -n | egrep ":${CEPH_PORT} .+LISTEN" 1>/dev/null 2>&1 || break
+  done
 fi
 
 [ -z "$INIT_CEPH" ] && INIT_CEPH=$CEPH_BIN/init-ceph