]> git.proxmox.com Git - ceph.git/blame - ceph/src/mstart.sh
update ceph source to reef 18.2.0
[ceph.git] / ceph / src / mstart.sh
CommitLineData
7c673cae
FG
1#!/bin/sh
2
3usage="usage: $0 <name> [vstart options]..\n"
4
5usage_exit() {
6 printf "$usage"
7 exit
8}
9
10[ $# -lt 1 ] && usage_exit
11
12
13instance=$1
14shift
15
16vstart_path=`dirname $0`
17
18root_path=`dirname $0`
19root_path=`(cd $root_path; pwd)`
20
9f95a23c
TL
21[ -z "$BUILD_DIR" ] && BUILD_DIR=build
22
7c673cae
FG
23if [ -e CMakeCache.txt ]; then
24 root_path=$PWD
9f95a23c
TL
25elif [ -e $root_path/../${BUILD_DIR}/CMakeCache.txt ]; then
26 cd $root_path/../${BUILD_DIR}
7c673cae
FG
27 root_path=$PWD
28fi
29RUN_ROOT_PATH=${root_path}/run
7c673cae
FG
30
31mkdir -p $RUN_ROOT_PATH
32
11fdf7f2
TL
33if [ -z "$CLUSTERS_LIST" ]
34then
35 CLUSTERS_LIST=$RUN_ROOT_PATH/.clusters.list
36fi
7c673cae
FG
37
38if [ ! -f $CLUSTERS_LIST ]; then
39touch $CLUSTERS_LIST
40fi
41
42pos=`grep -n -w $instance $CLUSTERS_LIST`
43if [ $? -ne 0 ]; then
44 echo $instance >> $CLUSTERS_LIST
45 pos=`grep -n -w $instance $CLUSTERS_LIST`
46fi
47
48pos=`echo $pos | cut -d: -f1`
49base_port=$((6800+pos*20))
50rgw_port=$((8000+pos*1))
51
1e59de90
TL
52[ -z "$VSTART_DEST" ] && export VSTART_DEST=$RUN_ROOT_PATH/$instance
53[ -z "$CEPH_PORT" ] && export CEPH_PORT=$base_port
54[ -z "$CEPH_RGW_PORT" ] && export CEPH_RGW_PORT=$rgw_port
7c673cae
FG
55
56mkdir -p $VSTART_DEST
57
58echo "Cluster dest path: $VSTART_DEST"
59echo "monitors base port: $CEPH_PORT"
60echo "rgw base port: $CEPH_RGW_PORT"
61
62$vstart_path/vstart.sh "$@"