From bdbe6d98dbb1f1ef8b2e981760134c45499aabe3 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Tue, 13 Sep 2011 09:43:46 -0700 Subject: [PATCH] allow for enabling/disabling of services. separate source dir from opt in lxc --- build_lxc.sh | 4 ++-- stack.sh | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build_lxc.sh b/build_lxc.sh index e4fda6e..628ac85 100755 --- a/build_lxc.sh +++ b/build_lxc.sh @@ -97,8 +97,8 @@ echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # Install and run stack.sh apt-get update apt-get -y --force-yes install git-core vim-nox sudo -su -c "git clone git://github.com/cloudbuilders/nfs-stack.git /opt/nfs-stack" stack -su -c "cd /opt/nfs-stack && ./stack.sh" stack +su -c "git clone git://github.com/cloudbuilders/nfs-stack.git ~/nfs-stack" stack +su -c "cd ~/nfs-stack && ./stack.sh" stack EOF chmod 700 $INSTALL_SH diff --git a/stack.sh b/stack.sh index 3d21df5..21a66ed 100755 --- a/stack.sh +++ b/stack.sh @@ -34,6 +34,7 @@ KEYSTONE_DIR=$DEST/keystone NOVACLIENT_DIR=$DEST/python-novaclient API_DIR=$DEST/openstackx NOVNC_DIR=$DEST/noVNC +ENABLED_SERVICES=g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash # Use the first IP unless an explicit is set by ``HOST_IP`` environment variable if [ ! -n "$HOST_IP" ]; then @@ -248,9 +249,13 @@ 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 - screen -S nova -p $1 -X stuff "$2$NL" + # only run the services specified in $ENABLED_SERVICES + if [[ $ENABLED_SERVICES == *$2* ]] then + screen -S nova -p $1 -X stuff "$2$NL" + fi } screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf"