]> git.proxmox.com Git - ceph.git/blob - ceph/src/mrgw.sh
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / mrgw.sh
1 #!/usr/bin/env bash
2
3 set -e
4
5 rgw_frontend=${RGW_FRONTEND:-"beast"}
6 script_root=$(dirname "$0")
7 script_root=$(cd "$script_root" && pwd)
8 [ -z "$BUILD_DIR" ] && BUILD_DIR=build
9 if [ -e CMakeCache.txt ]; then
10 script_root=$PWD
11 elif [ -e "$script_root"/../${BUILD_DIR}/CMakeCache.txt ]; then
12 cd "$script_root"/../${BUILD_DIR}
13 script_root=$PWD
14 fi
15 #ceph_bin=$script_root/bin
16 vstart_path=$(dirname "$0")
17
18 [ "$#" -lt 3 ] && echo "usage: $0 <name> <port> <ssl-port> [params...]" && exit 1
19
20 name=$1
21 port=$2
22 ssl_port=$3
23 cert_param=""
24 port_param="port=$port"
25
26 if [ "$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
33 fi
34
35 if [ -n "$RGW_FRONTEND_THREADS" ]; then
36 set_frontend_threads="num_threads=$RGW_FRONTEND_THREADS"
37 fi
38
39 shift 3
40
41 run_root=$script_root/run/$name
42 pidfile=$run_root/out/radosgw.${port}.pid
43 asokfile=$run_root/out/radosgw.${port}.asok
44 logfile=$run_root/out/radosgw.${port}.log
45
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
51
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"