From 1003952b169472992792226b8ffdca5b92b3ac8e Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 13 Sep 2011 10:05:07 -0700 Subject: [PATCH] comment tweaks, provide CLEAN option to stack.sh --- build_lxc.sh | 2 +- stack.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build_lxc.sh b/build_lxc.sh index d3dd7ad..5e07b1a 100755 --- a/build_lxc.sh +++ b/build_lxc.sh @@ -77,7 +77,7 @@ if [ "$COPYENV" = "1" ]; then cp -pr ~/.bashrc $ROOTFS/opt/.bashrc fi -# give stack ownership over /opt so it may do the work needed +# Give stack ownership over /opt so it may do the work needed chroot $ROOTFS chown -R stack /opt # Configure instance network diff --git a/stack.sh b/stack.sh index 21a66ed..0fe84ad 100755 --- a/stack.sh +++ b/stack.sh @@ -26,6 +26,13 @@ set -o xtrace DIR=`pwd` DEST=/opt +# Provide option to move aside any old code +if [ "$CLEAN" = "1"]; then + TMPDIR=/tmp/stackbak_`date +%s` + mkdir $TMPDIR + mv $DEST/* $TMPDIR +fi + # Set the destination directories for openstack projects NOVA_DIR=$DEST/nova DASH_DIR=$DEST/dash @@ -249,7 +256,6 @@ rm -f $GLANCE_DIR/glance.sqlite # nova api crashes if we start it with a regular screen command, # so send the start command by forcing text into the window. -ENABLED_SERVICES=g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash function screen_it { screen -S nova -X screen -t $1 # only run the services specified in $ENABLED_SERVICES