From: Patrick Donnelly Date: Fri, 8 Jul 2016 23:00:12 +0000 (-0400) Subject: vstart: refactor and fix forced config changes X-Git-Tag: ses5-milestone5~255^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10312%2Fhead;p=ceph.git vstart: refactor and fix forced config changes Despite using the -k option, vstart would sometimes (e.g. --smallmds) append changes to the config file. This commit runs all config changes through a function which checks if the config file should be overwritten. Signed-off-by: Patrick Donnelly --- diff --git a/src/vstart.sh b/src/vstart.sh index 4d53bef41ca..c5fc5c707d6 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -289,6 +289,8 @@ if [ "$overwrite_conf" -eq 0 ]; then CEPH_NUM_MDS="$MDS" RGW=`$CEPH_BIN/ceph-conf -c $conf_fn --name $VSTART_SEC num_rgw 2>/dev/null` && \ CEPH_NUM_RGW="$RGW" +else + rm -- "$conf_fn" fi if [ "$start_all" -eq 1 ]; then @@ -327,6 +329,12 @@ run() { fi } +wconf() { + if [ "$overwrite_conf" -eq 1 ]; then + cat >> "$conf_fn" + fi +} + if [ "$debug" -eq 0 ]; then CMONDEBUG=' debug mon = 10 @@ -457,10 +465,8 @@ DAEMONOPTS=" if [ "$start_mon" -eq 1 ]; then - if [ "$new" -eq 1 ]; then - if [ $overwrite_conf -eq 1 ]; then - cat < $conf_fn + wconf <> $conf_fn + if [ "$lockdep" -eq 1 ] ; then + wconf <> $conf_fn + fi + if [ "$cephx" -eq 1 ] ; then + wconf <> $conf_fn + else + wconf <> $conf_fn - + fi + wconf <> $conf_fn + wconf <> $conf_fn + wconf < /dev/null || true; done @@ -654,7 +653,7 @@ fi # mds if [ "$smallmds" -eq 1 ]; then - cat <> $conf_fn + wconf <> $conf_fn + wconf <> $conf_fn + wconf <