This commit moves check to see if screen is already running after reading
stackrc, and changes messages in check if root is running DevStack.
STACK_USER is defined in stackrc, and SCREEN_NAME can be replaced with
"a non-root account".
Change-Id: I022ed1099169a3549b7e31883abe33d6298f6fa5
Closes-Bug: #1362091
... | ... |
@@ -69,20 +69,11 @@ if [[ $EUID -eq 0 ]]; then |
69 | 69 |
echo "You are running this script as root." |
70 | 70 |
echo "Cut it out." |
71 | 71 |
echo "Really." |
72 |
- echo "If you need an account to run DevStack, do this (as root, heh) to create $STACK_USER:" |
|
72 |
+ echo "If you need an account to run DevStack, do this (as root, heh) to create a non-root account:" |
|
73 | 73 |
echo "$TOP_DIR/tools/create-stack-user.sh" |
74 | 74 |
exit 1 |
75 | 75 |
fi |
76 | 76 |
|
77 |
-# Check to see if we are already running DevStack |
|
78 |
-# Note that this may fail if USE_SCREEN=False |
|
79 |
-if type -p screen >/dev/null && screen -ls | egrep -q "[0-9].$SCREEN_NAME"; then |
|
80 |
- echo "You are already running a stack.sh session." |
|
81 |
- echo "To rejoin this session type 'screen -x stack'." |
|
82 |
- echo "To destroy this session, type './unstack.sh'." |
|
83 |
- exit 1 |
|
84 |
-fi |
|
85 |
- |
|
86 | 77 |
|
87 | 78 |
# Prepare the environment |
88 | 79 |
# ----------------------- |
... | ... |
@@ -130,6 +121,7 @@ if [[ -r $TOP_DIR/local.conf ]]; then |
130 | 130 |
done |
131 | 131 |
fi |
132 | 132 |
|
133 |
+ |
|
133 | 134 |
# ``stack.sh`` is customizable by setting environment variables. Override a |
134 | 135 |
# default setting via export:: |
135 | 136 |
# |
... | ... |
@@ -158,6 +150,15 @@ if [[ ! -r $TOP_DIR/stackrc ]]; then |
158 | 158 |
fi |
159 | 159 |
source $TOP_DIR/stackrc |
160 | 160 |
|
161 |
+# Check to see if we are already running DevStack |
|
162 |
+# Note that this may fail if USE_SCREEN=False |
|
163 |
+if type -p screen > /dev/null && screen -ls | egrep -q "[0-9]\.$SCREEN_NAME"; then |
|
164 |
+ echo "You are already running a stack.sh session." |
|
165 |
+ echo "To rejoin this session type 'screen -x stack'." |
|
166 |
+ echo "To destroy this session, type './unstack.sh'." |
|
167 |
+ exit 1 |
|
168 |
+fi |
|
169 |
+ |
|
161 | 170 |
|
162 | 171 |
# Local Settings |
163 | 172 |
# -------------- |