... | ... |
@@ -1370,7 +1370,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`` |
|
1373 |
+# ``SERVICE_DIR``, ``USE_SCREEN``, ``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. |
... | ... |
@@ -1390,8 +1390,12 @@ function screen_process { |
1390 | 1390 |
echo "SCREEN_LOGDIR: $SCREEN_LOGDIR" |
1391 | 1391 |
echo "log: $real_logfile" |
1392 | 1392 |
if [[ -n ${LOGDIR} ]]; then |
1393 |
- screen -S $SCREEN_NAME -p $name -X logfile "$real_logfile" |
|
1394 |
- screen -S $SCREEN_NAME -p $name -X log on |
|
1393 |
+ if [[ "$SCREEN_IS_LOGGING" == "True" ]]; then |
|
1394 |
+ screen -S $SCREEN_NAME -p $name -X logfile "$real_logfile" |
|
1395 |
+ screen -S $SCREEN_NAME -p $name -X log on |
|
1396 |
+ fi |
|
1397 |
+ # If logging isn't active then avoid a broken symlink |
|
1398 |
+ touch "$real_logfile" |
|
1395 | 1399 |
ln -sf "$real_logfile" ${LOGDIR}/${name}.log |
1396 | 1400 |
if [[ -n ${SCREEN_LOGDIR} ]]; then |
1397 | 1401 |
# Drop the backward-compat symlink |
... | ... |
@@ -1430,7 +1434,7 @@ function screen_process { |
1430 | 1430 |
} |
1431 | 1431 |
|
1432 | 1432 |
# Screen rc file builder |
1433 |
-# Uses globals ``SCREEN_NAME``, ``SCREENRC`` |
|
1433 |
+# Uses globals ``SCREEN_NAME``, ``SCREENRC``, ``SCREEN_IS_LOGGING`` |
|
1434 | 1434 |
# screen_rc service "command-line" |
1435 | 1435 |
function screen_rc { |
1436 | 1436 |
SCREEN_NAME=${SCREEN_NAME:-stack} |
... | ... |
@@ -1450,7 +1454,7 @@ function screen_rc { |
1450 | 1450 |
echo "screen -t $1 bash" >> $SCREENRC |
1451 | 1451 |
echo "stuff \"$2$NL\"" >> $SCREENRC |
1452 | 1452 |
|
1453 |
- if [[ -n ${LOGDIR} ]]; then |
|
1453 |
+ if [[ -n ${LOGDIR} ]] && [[ "$SCREEN_IS_LOGGING" == "True" ]]; then |
|
1454 | 1454 |
echo "logfile ${LOGDIR}/${1}.log.${CURRENT_LOG_TIME}" >>$SCREENRC |
1455 | 1455 |
echo "log on" >>$SCREENRC |
1456 | 1456 |
fi |
... | ... |
@@ -103,6 +103,16 @@ HORIZON_APACHE_ROOT="/dashboard" |
103 | 103 |
# be disabled for automated testing by setting this value to False. |
104 | 104 |
USE_SCREEN=True |
105 | 105 |
|
106 |
+# When using screen, should we keep a log file on disk? You might |
|
107 |
+# want this False if you have a long-running setup where verbose logs |
|
108 |
+# can fill-up the host. |
|
109 |
+# XXX: Ideally screen itself would be configured to log but just not |
|
110 |
+# activate. This isn't possible with the screerc syntax. Temporary |
|
111 |
+# logging can still be used by a developer with: |
|
112 |
+# C-a : logfile foo |
|
113 |
+# C-a : log on |
|
114 |
+SCREEN_IS_LOGGING=$(trueorfalse True SCREEN_IS_LOGGING) |
|
115 |
+ |
|
106 | 116 |
# Passwords generated by interactive devstack runs |
107 | 117 |
if [[ -r $RC_DIR/.localrc.password ]]; then |
108 | 118 |
source $RC_DIR/.localrc.password |