From 6e137abbfe66837bc7456425472b53d067591d24 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 29 Apr 2015 08:22:24 -0400 Subject: [PATCH] clean up logging around run_process We do a bunch of exec magic unwind in run_process that leads to a lot of confusing lines in the logs under xtrace. Instead, disable xtrace through these parts to ensure that the flow at the end of the day makes more sense. Change-Id: I91e02465240e704a1a0c0036f5073c0295be018e --- functions-common | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions-common b/functions-common index a3b8b92f5f..f2e7076ccf 100644 --- a/functions-common +++ b/functions-common @@ -1137,6 +1137,10 @@ function zypper_install { # the command. # _run_process service "command-line" [group] function _run_process { + # disable tracing through the exec redirects, it's just confusing in the logs. + xtrace=$(set +o | grep xtrace) + set +o xtrace + local service=$1 local command="$2" local group=$3 @@ -1160,6 +1164,9 @@ function _run_process { export PYTHONUNBUFFERED=1 fi + # reenable xtrace before we do *real* work + $xtrace + # Run under ``setsid`` to force the process to become a session and group leader. # The pid saved can be used with pkill -g to get the entire process group. if [[ -n "$group" ]]; then