diff --git a/functions-common b/functions-common index 5c97aee9a3..3eeab09889 100644 --- a/functions-common +++ b/functions-common @@ -1352,6 +1352,7 @@ function is_running { # If the command includes shell metachatacters (;<>*) it must be run using a shell # If an optional group is provided sg will be used to run the # command as that group. +# Uses globals ``USE_SCREEN`` # run_process service "command-line" [group] function run_process { local service=$1 @@ -1370,7 +1371,7 @@ function run_process { # Helper to launch a process in a named screen # Uses globals ``CURRENT_LOG_TIME``, ```LOGDIR``, ``SCREEN_LOGDIR``, `SCREEN_NAME``, -# ``SERVICE_DIR``, ``USE_SCREEN``, ``SCREEN_IS_LOGGING`` +# ``SERVICE_DIR``, ``SCREEN_IS_LOGGING`` # screen_process name "command-line" [group] # Run a command in a shell in a screen window, if an optional group # is provided, use sg to set the group of the command. @@ -1381,7 +1382,6 @@ function screen_process { SCREEN_NAME=${SCREEN_NAME:-stack} SERVICE_DIR=${SERVICE_DIR:-${DEST}/status} - USE_SCREEN=$(trueorfalse True USE_SCREEN) screen -S $SCREEN_NAME -X screen -t $name @@ -1465,14 +1465,13 @@ function screen_rc { # If a PID is available use it, kill the whole process group via TERM # If screen is being used kill the screen window; this will catch processes # that did not leave a PID behind -# Uses globals ``SCREEN_NAME``, ``SERVICE_DIR``, ``USE_SCREEN`` +# Uses globals ``SCREEN_NAME``, ``SERVICE_DIR`` # screen_stop_service service function screen_stop_service { local service=$1 SCREEN_NAME=${SCREEN_NAME:-stack} SERVICE_DIR=${SERVICE_DIR:-${DEST}/status} - USE_SCREEN=$(trueorfalse True USE_SCREEN) if is_service_enabled $service; then # Clean up the screen window @@ -1490,7 +1489,6 @@ function stop_process { local service=$1 SERVICE_DIR=${SERVICE_DIR:-${DEST}/status} - USE_SCREEN=$(trueorfalse True USE_SCREEN) if is_service_enabled $service; then # Kill via pid if we have one available @@ -1552,11 +1550,11 @@ function service_check { } # Tail a log file in a screen if USE_SCREEN is true. +# Uses globals ``USE_SCREEN`` function tail_log { local name=$1 local logfile=$2 - USE_SCREEN=$(trueorfalse True USE_SCREEN) if [[ "$USE_SCREEN" = "True" ]]; then screen_process "$name" "sudo tail -f $logfile" fi diff --git a/stackrc b/stackrc index 76a5756dde..4f459397a0 100644 --- a/stackrc +++ b/stackrc @@ -101,7 +101,7 @@ HORIZON_APACHE_ROOT="/dashboard" # ctrl-c, up-arrow, enter to restart the service. Starting services # this way is slightly unreliable, and a bit slower, so this can # be disabled for automated testing by setting this value to False. -USE_SCREEN=True +USE_SCREEN=$(trueorfalse True USE_SCREEN) # When using screen, should we keep a log file on disk? You might # want this False if you have a long-running setup where verbose logs