From 44719368a572cab71a9ef924e7db426b6c50cc38 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Fri, 30 Nov 2018 11:36:23 +0100 Subject: [PATCH] WIP: Avoid FD juggling in scriptlets --- .../script-common-header-last.sh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/packaging/common/script-templates/script-common-header-last.sh b/packaging/common/script-templates/script-common-header-last.sh index b09e9a355..e2e841b17 100644 --- a/packaging/common/script-templates/script-common-header-last.sh +++ b/packaging/common/script-templates/script-common-header-last.sh @@ -21,29 +21,12 @@ is_nova() test "$PROJECT_TYPE" = "cfengine-nova" || test "$PROJECT_TYPE" = "cfengine-nova-hub" } -INSTLOG=/var/log/CFEngineHub-Install.log -mkdir -p "$(dirname "$INSTLOG")" -CONSOLE=7 -# Redirect most output to log file, but keep console around for custom output. -case "$SCRIPT_TYPE" in - pre*) - eval "exec $CONSOLE>&1 > $INSTLOG 2>&1" - ;; - *) - eval "exec $CONSOLE>&1 >> $INSTLOG 2>&1" - ;; -esac echo "$SCRIPT_TYPE:" # Output directly to console, bypassing log. cf_console() { - # Use subshell to prevent "set +x" from leaking out into the rest of the - # execution. - ( - set +x - "$@" 1>&$CONSOLE 2>&$CONSOLE - ) + "$@" } set -x