summaryrefslogtreecommitdiffstats
path: root/src/mstart.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/mstart.sh
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/mstart.sh')
-rwxr-xr-xsrc/mstart.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/mstart.sh b/src/mstart.sh
new file mode 100755
index 000000000..4bf3bde4b
--- /dev/null
+++ b/src/mstart.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+usage="usage: $0 <name> [vstart options]..\n"
+
+usage_exit() {
+ printf "$usage"
+ exit
+}
+
+[ $# -lt 1 ] && usage_exit
+
+
+instance=$1
+shift
+
+vstart_path=`dirname $0`
+
+root_path=`dirname $0`
+root_path=`(cd $root_path; pwd)`
+
+[ -z "$BUILD_DIR" ] && BUILD_DIR=build
+
+if [ -e CMakeCache.txt ]; then
+ root_path=$PWD
+elif [ -e $root_path/../${BUILD_DIR}/CMakeCache.txt ]; then
+ cd $root_path/../${BUILD_DIR}
+ root_path=$PWD
+fi
+RUN_ROOT_PATH=${root_path}/run
+
+mkdir -p $RUN_ROOT_PATH
+
+if [ -z "$CLUSTERS_LIST" ]
+then
+ CLUSTERS_LIST=$RUN_ROOT_PATH/.clusters.list
+fi
+
+if [ ! -f $CLUSTERS_LIST ]; then
+touch $CLUSTERS_LIST
+fi
+
+pos=`grep -n -w $instance $CLUSTERS_LIST`
+if [ $? -ne 0 ]; then
+ echo $instance >> $CLUSTERS_LIST
+ pos=`grep -n -w $instance $CLUSTERS_LIST`
+fi
+
+pos=`echo $pos | cut -d: -f1`
+base_port=$((6800+pos*20))
+rgw_port=$((8000+pos*1))
+
+export VSTART_DEST=$RUN_ROOT_PATH/$instance
+export CEPH_PORT=$base_port
+export CEPH_RGW_PORT=$rgw_port
+
+mkdir -p $VSTART_DEST
+
+echo "Cluster dest path: $VSTART_DEST"
+echo "monitors base port: $CEPH_PORT"
+echo "rgw base port: $CEPH_RGW_PORT"
+
+$vstart_path/vstart.sh "$@"