specify session name on perform rejoin stack

rejoin-stack.sh would not specify screen session name which will lead
unstack.sh unable to kill the screen session started by rejoin-stack.sh
after hypervisor rebooted. So specify the session name if
rejoin-stack.sh need to start a new sreen session.

fixes bug 1182806

Change-Id: I68635887aa82fa63f3667e0f090ea2836eec7b68
This commit is contained in:
Jiajun Liu 2013-05-22 08:55:25 +00:00 committed by Jiajun Liu
parent eff14644b0
commit f02be85cc8
3 changed files with 6 additions and 2 deletions

View File

@ -5,13 +5,15 @@
TOP_DIR=`dirname $0` TOP_DIR=`dirname $0`
source $TOP_DIR/stackrc
# if screenrc exists, run screen # if screenrc exists, run screen
if [[ -e $TOP_DIR/stack-screenrc ]]; then if [[ -e $TOP_DIR/stack-screenrc ]]; then
if screen -ls | egrep -q "[0-9].stack"; then if screen -ls | egrep -q "[0-9].stack"; then
echo "Attaching to already started screen session.." echo "Attaching to already started screen session.."
exec screen -r stack exec screen -r stack
fi fi
exec screen -c $TOP_DIR/stack-screenrc exec screen -c $TOP_DIR/stack-screenrc -S $SCREEN_NAME
fi fi
echo "Couldn't find $TOP_DIR/stack-screenrc file; have you run stack.sh yet?" echo "Couldn't find $TOP_DIR/stack-screenrc file; have you run stack.sh yet?"

View File

@ -125,7 +125,6 @@ fi
# and the specified rpc backend is available on your platform. # and the specified rpc backend is available on your platform.
check_rpc_backend check_rpc_backend
SCREEN_NAME=${SCREEN_NAME:-stack}
# Check to see if we are already running DevStack # Check to see if we are already running DevStack
# Note that this may fail if USE_SCREEN=False # Note that this may fail if USE_SCREEN=False
if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].$SCREEN_NAME"; then if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].$SCREEN_NAME"; then

View File

@ -245,6 +245,9 @@ PUBLIC_NETWORK_NAME=${PUBLIC_NETWORK_NAME:-"public"}
# Compatibility until it's eradicated from CI # Compatibility until it's eradicated from CI
USE_SCREEN=${SCREEN_DEV:-$USE_SCREEN} USE_SCREEN=${SCREEN_DEV:-$USE_SCREEN}
# Set default screen name
SCREEN_NAME=${SCREEN_NAME:-stack}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script
# End: # End: