Skip to content

Commit 6e137ab

Browse files
sdagueianw
authored andcommitted
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
1 parent 43dcab9 commit 6e137ab

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

functions-common

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,10 @@ function zypper_install {
11371137
# the command.
11381138
# _run_process service "command-line" [group]
11391139
function _run_process {
1140+
# disable tracing through the exec redirects, it's just confusing in the logs.
1141+
xtrace=$(set +o | grep xtrace)
1142+
set +o xtrace
1143+
11401144
local service=$1
11411145
local command="$2"
11421146
local group=$3
@@ -1160,6 +1164,9 @@ function _run_process {
11601164
export PYTHONUNBUFFERED=1
11611165
fi
11621166

1167+
# reenable xtrace before we do *real* work
1168+
$xtrace
1169+
11631170
# Run under ``setsid`` to force the process to become a session and group leader.
11641171
# The pid saved can be used with pkill -g to get the entire process group.
11651172
if [[ -n "$group" ]]; then

0 commit comments

Comments
 (0)