From f51ff28f87c6202c3478018baedee6d58fd1e87e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 21 Jan 2015 13:03:57 -0800 Subject: [PATCH] vstart.sh: pull default CEPH_PORT from .ceph_port This lets you put a unique port in .ceph_port in your working dir and vstart.sh instances will avoid each other without having to pass CEPH_PORT=... to each one each time. Signed-off-by: Sage Weil --- src/.gitignore | 1 + src/vstart.sh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/.gitignore b/src/.gitignore index 531da972b227d..d714f13a72c14 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -82,3 +82,4 @@ Makefile # old dir, may in use by older branches /leveldb /mkcephfs +/.ceph_port diff --git a/src/vstart.sh b/src/vstart.sh index 469180d7a235d..f766cf1179d52 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -261,7 +261,10 @@ fi # export CEPH_ARGS="--lockdep 1" [ -z "$CEPH_BIN" ] && CEPH_BIN=. -[ -z "$CEPH_PORT" ] && CEPH_PORT=6789 +if [ -z "$CEPH_PORT" ]; then + CEPH_PORT=6789 + [ -e ".ceph.port" ] && CEPH_PORT=`cat .ceph_port` +fi # sudo if btrfs @@ -294,6 +297,7 @@ else echo ip $IP fi echo "ip $IP" +echo "port $PORT" -- 2.39.5