f02be85cc8
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
21 lines
547 B
Bash
Executable File
21 lines
547 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
# This script rejoins an existing screen, or re-creates a
|
|
# screen session from a previous run of stack.sh.
|
|
|
|
TOP_DIR=`dirname $0`
|
|
|
|
source $TOP_DIR/stackrc
|
|
|
|
# if screenrc exists, run screen
|
|
if [[ -e $TOP_DIR/stack-screenrc ]]; then
|
|
if screen -ls | egrep -q "[0-9].stack"; then
|
|
echo "Attaching to already started screen session.."
|
|
exec screen -r stack
|
|
fi
|
|
exec screen -c $TOP_DIR/stack-screenrc -S $SCREEN_NAME
|
|
fi
|
|
|
|
echo "Couldn't find $TOP_DIR/stack-screenrc file; have you run stack.sh yet?"
|
|
exit 1
|