]> git.proxmox.com Git - ceph.git/blame - ceph/src/mrgw.sh
import ceph 16.2.6
[ceph.git] / ceph / src / mrgw.sh
CommitLineData
11fdf7f2 1#!/usr/bin/env bash
7c673cae
FG
2
3set -e
4
11fdf7f2 5rgw_frontend=${RGW_FRONTEND:-"beast"}
9f95a23c
TL
6script_root=$(dirname "$0")
7script_root=$(cd "$script_root" && pwd)
8[ -z "$BUILD_DIR" ] && BUILD_DIR=build
7c673cae
FG
9if [ -e CMakeCache.txt ]; then
10 script_root=$PWD
9f95a23c
TL
11elif [ -e "$script_root"/../${BUILD_DIR}/CMakeCache.txt ]; then
12 cd "$script_root"/../${BUILD_DIR}
7c673cae
FG
13 script_root=$PWD
14fi
9f95a23c
TL
15#ceph_bin=$script_root/bin
16vstart_path=$(dirname "$0")
7c673cae 17
9f95a23c 18[ "$#" -lt 3 ] && echo "usage: $0 <name> <port> <ssl-port> [params...]" && exit 1
7c673cae
FG
19
20name=$1
21port=$2
9f95a23c
TL
22ssl_port=$3
23cert_param=""
24port_param="port=$port"
25
26if [ "$ssl_port" -gt 0 ]; then
27 cert_param="ssl_certificate=./cert.pem"
28 if [ "$rgw_frontend" = "civetweb" ]; then
29 port_param="port=${port} port=${ssl_port}s"
30 else
31 port_param="port=${port} ssl_port=${ssl_port}"
32 fi
33fi
34
35if [ -n "$RGW_FRONTEND_THREADS" ]; then
36 set_frontend_threads="num_threads=$RGW_FRONTEND_THREADS"
37fi
7c673cae 38
9f95a23c 39shift 3
7c673cae
FG
40
41run_root=$script_root/run/$name
42pidfile=$run_root/out/radosgw.${port}.pid
43asokfile=$run_root/out/radosgw.${port}.asok
44logfile=$run_root/out/radosgw.${port}.log
45
9f95a23c
TL
46"$vstart_path"/mstop.sh "$name" radosgw "$port"
47
48"$vstart_path"/mrun "$name" ceph -c "$run_root"/ceph.conf \
49 -k "$run_root"/keyring auth get-or-create client.rgw."$port" mon \
50 'allow rw' osd 'allow rwx' mgr 'allow rw' >> "$run_root"/keyring
7c673cae 51
9f95a23c
TL
52"$vstart_path"/mrun "$name" radosgw --rgw-frontends="$rgw_frontend $port_param $set_frontend_threads $cert_param" \
53 -n client.rgw."$port" --pid-file="$pidfile" \
54 --admin-socket="$asokfile" "$@" --log-file="$logfile"