From 2eb1f55a8c0ac26ac55f8613c0483a8631e5fb5b Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 16 Jun 2014 10:24:13 +0400 Subject: [PATCH 1/2] vstart.sh: rename conf variable to conf_fn Signed-off-by: Ilya Dryomov --- src/vstart.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index 396ad3b82ca..c353172a9f2 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -45,8 +45,7 @@ journal=1 MON_ADDR="" -conf="$CEPH_DIR/ceph.conf" - +conf_fn="$CEPH_DIR/ceph.conf" keyring_fn="$CEPH_DIR/keyring" osdmap_fn="/tmp/ceph_osdmap.$$" monmap_fn="/tmp/ceph_monmap.$$" @@ -190,7 +189,7 @@ if [ "$start_all" -eq 1 ]; then start_osd=1 fi -ARGS="-c $conf" +ARGS="-c $conf_fn" run() { type=$1 @@ -298,9 +297,9 @@ echo "ip $IP" if [ "$cephx" -eq 1 ]; then - CEPH_ADM="$CEPH_BIN/ceph -c $conf -k $keyring_fn" + CEPH_ADM="$CEPH_BIN/ceph -c $conf_fn -k $keyring_fn" else - CEPH_ADM="$CEPH_BIN/ceph -c $conf" + CEPH_ADM="$CEPH_BIN/ceph -c $conf_fn" fi MONS="" @@ -330,7 +329,7 @@ if [ "$start_mon" -eq 1 ]; then if [ "$new" -eq 1 ]; then if [ $overwrite_conf -eq 1 ]; then - cat < $conf + cat < $conf_fn ; generated by vstart.sh on `date` [global] fsid = $(uuidgen) @@ -343,11 +342,11 @@ if [ "$start_mon" -eq 1 ]; then run dir = $CEPH_OUT_DIR EOF if [ "$cephx" -eq 1 ] ; then -cat <> $conf +cat <> $conf_fn auth supported = cephx EOF else -cat <> $conf +cat <> $conf_fn auth cluster required = none auth service required = none auth client required = none @@ -358,7 +357,7 @@ fi else journal_path="" fi - cat <> $conf + cat <> $conf_fn [client] keyring = $keyring_fn @@ -420,7 +419,7 @@ EOF do str=$str" --add $f $IP:$(($CEPH_PORT+$count))" if [ $overwrite_conf -eq 1 ]; then - cat <> $conf + cat <> $conf_fn [mon.$f] host = $HOSTNAME mon data = $CEPH_DEV_DIR/mon.$f @@ -441,7 +440,7 @@ EOF cmd="mkdir -p $CEPH_DEV_DIR/mon.$f" echo $cmd $cmd - cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf -i $f --monmap=$monmap_fn" + cmd="$CEPH_BIN/ceph-mon --mkfs -c $conf_fn -i $f --monmap=$monmap_fn" cmd="$cmd --keyring=$keyring_fn" echo $cmd $cmd @@ -465,7 +464,7 @@ if [ "$start_osd" -eq 1 ]; then do if [ "$new" -eq 1 ]; then if [ $overwrite_conf -eq 1 ]; then - cat <> $conf + cat <> $conf_fn [osd.$osd] host = $HOSTNAME EOF @@ -491,7 +490,7 @@ fi # mds if [ "$smallmds" -eq 1 ]; then - cat <> $conf + cat <> $conf_fn [mds] mds log max segments = 2 mds cache size = 10000 @@ -506,13 +505,13 @@ if [ "$start_mds" -eq 1 -a "$CEPH_NUM_MDS" -gt 0 ]; then mkdir -p $CEPH_DEV_DIR/mds.$name key_fn=$CEPH_DEV_DIR/mds.$name/keyring if [ $overwrite_conf -eq 1 ]; then - cat <> $conf + cat <> $conf_fn [mds.$name] host = $HOSTNAME EOF if [ "$standby" -eq 1 ]; then mkdir -p $CEPH_DEV_DIR/mds.${name}s - cat <> $conf + cat <> $conf_fn mds standby for rank = $mds [mds.${name}s] mds standby replay = true @@ -556,7 +555,7 @@ if [ "$start_rgw" -eq 1 ]; then if [ "$new" -eq 1 ]; then if [ $overwrite_conf -eq 1 ]; then dnsname=`hostname -f` - cat <> $conf + cat <> $conf_fn [client.radosgw.rgw$rgw] host = $HOSTNAME $DAEMONOPTS @@ -620,7 +619,7 @@ EOF skey='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==' echo access key $akey echo secret key $skey - $CEPH_BIN/radosgw-admin user create --uid tester --access-key $akey --secret $skey --display-name 'M. Tester' --email tester@ceph.com -c $conf + $CEPH_BIN/radosgw-admin user create --uid tester --access-key $akey --secret $skey --display-name 'M. Tester' --email tester@ceph.com -c $conf_fn fi fi echo start rgw$rgw on http://localhost:$rgwport From 8d1cb8bad244cd89745e520f6cc9040b26c3cddf Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 16 Jun 2014 10:24:13 +0400 Subject: [PATCH 2/2] vstart.sh: echo CEPH_{CONF,KEYRING} exports if necessary If CEPH_DIR is not PWD, echo export statements for CEPH_{CONF,KEYRING}. Signed-off-by: Ilya Dryomov --- src/vstart.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index c353172a9f2..8ac97dc57c3 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -18,7 +18,7 @@ set -e [ -z "$CEPH_NUM_MDS" ] && CEPH_NUM_MDS=3 [ -z "$CEPH_NUM_RGW" ] && CEPH_NUM_RGW=1 -[ -z "$CEPH_DIR" ] && CEPH_DIR="$PWD/" +[ -z "$CEPH_DIR" ] && CEPH_DIR="$PWD" [ -z "$CEPH_DEV_DIR" ] && CEPH_DEV_DIR="$CEPH_DIR/dev" [ -z "$CEPH_OUT_DIR" ] && CEPH_OUT_DIR="$CEPH_DIR/out" [ -z "$CEPH_RGW_PORT" ] && CEPH_RGW_PORT=8000 @@ -628,8 +628,6 @@ EOF done fi -echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output." - if [ "$ec" -eq 1 ]; then $SUDO $CEPH_ADM <