From 25ebbcd1a7bc95e69ad32b19245ce0990a29eaa7 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 17 Feb 2013 15:45:55 +0000 Subject: [PATCH] Bring back screen logs for noninteractive runs. * functions(screen_it): Prior to 58e2134 screen logs were generated even when run without $SCREEN_DEV. We want to be able to capture these with devstack-gate for later inspection, so this patch reintroduces that capability. Change-Id: Ife127b47d7700878e02285281854595bc6585972 --- functions | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/functions b/functions index 79c82a459d..ae63436ace 100644 --- a/functions +++ b/functions @@ -747,17 +747,19 @@ function screen_it { screen_rc "$1" "$2" screen -S $SCREEN_NAME -X screen -t $1 + + if [[ -n ${SCREEN_LOGDIR} ]]; then + screen -S $SCREEN_NAME -p $1 -X logfile ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log + screen -S $SCREEN_NAME -p $1 -X log on + ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log + fi + if [[ "$SCREEN_DEV" = "True" ]]; then # sleep to allow bash to be ready to be send the command - we are # creating a new window in screen and then sends characters, so if # bash isn't running by the time we send the command, nothing happens sleep 1.5 - if [[ -n ${SCREEN_LOGDIR} ]]; then - screen -S $SCREEN_NAME -p $1 -X logfile ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log - screen -S $SCREEN_NAME -p $1 -X log on - ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log - fi NL=`echo -ne '\015'` screen -S $SCREEN_NAME -p $1 -X stuff "$2 || touch \"$SERVICE_DIR/$SCREEN_NAME/$1.failure\"$NL" else