In a couple of places the tracking of USE_SCREEN has drifted from the
comments.
Correct that.
Change-Id: I63bdd5ca4de49bf653f5bc8f8e0e5efe67ef605c
| ... | ... |
@@ -1352,6 +1352,7 @@ function is_running {
|
| 1352 | 1352 |
# If the command includes shell metachatacters (;<>*) it must be run using a shell |
| 1353 | 1353 |
# If an optional group is provided sg will be used to run the |
| 1354 | 1354 |
# command as that group. |
| 1355 |
+# Uses globals ``USE_SCREEN`` |
|
| 1355 | 1356 |
# run_process service "command-line" [group] |
| 1356 | 1357 |
function run_process {
|
| 1357 | 1358 |
local service=$1 |
| ... | ... |
@@ -1370,7 +1371,7 @@ function run_process {
|
| 1370 | 1370 |
|
| 1371 | 1371 |
# Helper to launch a process in a named screen |
| 1372 | 1372 |
# Uses globals ``CURRENT_LOG_TIME``, ```LOGDIR``, ``SCREEN_LOGDIR``, `SCREEN_NAME``, |
| 1373 |
-# ``SERVICE_DIR``, ``USE_SCREEN``, ``SCREEN_IS_LOGGING`` |
|
| 1373 |
+# ``SERVICE_DIR``, ``SCREEN_IS_LOGGING`` |
|
| 1374 | 1374 |
# screen_process name "command-line" [group] |
| 1375 | 1375 |
# Run a command in a shell in a screen window, if an optional group |
| 1376 | 1376 |
# is provided, use sg to set the group of the command. |
| ... | ... |
@@ -1381,7 +1382,6 @@ function screen_process {
|
| 1381 | 1381 |
|
| 1382 | 1382 |
SCREEN_NAME=${SCREEN_NAME:-stack}
|
| 1383 | 1383 |
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
| 1384 |
- USE_SCREEN=$(trueorfalse True USE_SCREEN) |
|
| 1385 | 1384 |
|
| 1386 | 1385 |
screen -S $SCREEN_NAME -X screen -t $name |
| 1387 | 1386 |
|
| ... | ... |
@@ -1465,14 +1465,13 @@ function screen_rc {
|
| 1465 | 1465 |
# If a PID is available use it, kill the whole process group via TERM |
| 1466 | 1466 |
# If screen is being used kill the screen window; this will catch processes |
| 1467 | 1467 |
# that did not leave a PID behind |
| 1468 |
-# Uses globals ``SCREEN_NAME``, ``SERVICE_DIR``, ``USE_SCREEN`` |
|
| 1468 |
+# Uses globals ``SCREEN_NAME``, ``SERVICE_DIR`` |
|
| 1469 | 1469 |
# screen_stop_service service |
| 1470 | 1470 |
function screen_stop_service {
|
| 1471 | 1471 |
local service=$1 |
| 1472 | 1472 |
|
| 1473 | 1473 |
SCREEN_NAME=${SCREEN_NAME:-stack}
|
| 1474 | 1474 |
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
| 1475 |
- USE_SCREEN=$(trueorfalse True USE_SCREEN) |
|
| 1476 | 1475 |
|
| 1477 | 1476 |
if is_service_enabled $service; then |
| 1478 | 1477 |
# Clean up the screen window |
| ... | ... |
@@ -1490,7 +1489,6 @@ function stop_process {
|
| 1490 | 1490 |
local service=$1 |
| 1491 | 1491 |
|
| 1492 | 1492 |
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
| 1493 |
- USE_SCREEN=$(trueorfalse True USE_SCREEN) |
|
| 1494 | 1493 |
|
| 1495 | 1494 |
if is_service_enabled $service; then |
| 1496 | 1495 |
# Kill via pid if we have one available |
| ... | ... |
@@ -1552,11 +1550,11 @@ function service_check {
|
| 1552 | 1552 |
} |
| 1553 | 1553 |
|
| 1554 | 1554 |
# Tail a log file in a screen if USE_SCREEN is true. |
| 1555 |
+# Uses globals ``USE_SCREEN`` |
|
| 1555 | 1556 |
function tail_log {
|
| 1556 | 1557 |
local name=$1 |
| 1557 | 1558 |
local logfile=$2 |
| 1558 | 1559 |
|
| 1559 |
- USE_SCREEN=$(trueorfalse True USE_SCREEN) |
|
| 1560 | 1560 |
if [[ "$USE_SCREEN" = "True" ]]; then |
| 1561 | 1561 |
screen_process "$name" "sudo tail -f $logfile" |
| 1562 | 1562 |
fi |
| ... | ... |
@@ -101,7 +101,7 @@ HORIZON_APACHE_ROOT="/dashboard" |
| 101 | 101 |
# ctrl-c, up-arrow, enter to restart the service. Starting services |
| 102 | 102 |
# this way is slightly unreliable, and a bit slower, so this can |
| 103 | 103 |
# be disabled for automated testing by setting this value to False. |
| 104 |
-USE_SCREEN=True |
|
| 104 |
+USE_SCREEN=$(trueorfalse True USE_SCREEN) |
|
| 105 | 105 |
|
| 106 | 106 |
# When using screen, should we keep a log file on disk? You might |
| 107 | 107 |
# want this False if you have a long-running setup where verbose logs |