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
diff --git a/functions-common b/functions-common
index a3b8b92..f2e7076 100644
--- a/functions-common
+++ b/functions-common
@@ -1137,6 +1137,10 @@
# 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 @@
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