]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | #!/usr/bin/env bash |
7c673cae FG |
2 | |
3 | set -e | |
4 | ||
11fdf7f2 | 5 | rgw_frontend=${RGW_FRONTEND:-"beast"} |
9f95a23c TL |
6 | script_root=$(dirname "$0") |
7 | script_root=$(cd "$script_root" && pwd) | |
8 | [ -z "$BUILD_DIR" ] && BUILD_DIR=build | |
7c673cae FG |
9 | if [ -e CMakeCache.txt ]; then |
10 | script_root=$PWD | |
9f95a23c TL |
11 | elif [ -e "$script_root"/../${BUILD_DIR}/CMakeCache.txt ]; then |
12 | cd "$script_root"/../${BUILD_DIR} | |
7c673cae FG |
13 | script_root=$PWD |
14 | fi | |
9f95a23c TL |
15 | #ceph_bin=$script_root/bin |
16 | vstart_path=$(dirname "$0") | |
7c673cae | 17 | |
9f95a23c | 18 | [ "$#" -lt 3 ] && echo "usage: $0 <name> <port> <ssl-port> [params...]" && exit 1 |
7c673cae FG |
19 | |
20 | name=$1 | |
21 | port=$2 | |
9f95a23c TL |
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 | |
7c673cae | 38 | |
9f95a23c | 39 | shift 3 |
7c673cae FG |
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 | ||
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" |