From bb848cfd90d0e047b31b11d15674a6591255ccf6 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Mon, 28 Dec 2020 10:47:02 +0200 Subject: [PATCH] qa/standalone/ceph-helpers.sh: log meaningful PIDs for run_in_background() While the relevant comment says: '# Execute the command and prepend the output with its pid' the actual PID logged is the same for all background processes, which isn't very helpful. Signed-off-by: Ronen Friedman --- qa/standalone/ceph-helpers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/standalone/ceph-helpers.sh b/qa/standalone/ceph-helpers.sh index dbe004f8e19ea..c76c2f1b0e527 100755 --- a/qa/standalone/ceph-helpers.sh +++ b/qa/standalone/ceph-helpers.sh @@ -1998,7 +1998,7 @@ function run_in_background() { shift # Execute the command and prepend the output with its pid # We enforce to return the exit status of the command and not the sed one. - ("$@" |& sed 's/^/'$$': /'; return "${PIPESTATUS[0]}") >&2 & + ("$@" |& sed 's/^/'$BASHPID': /'; return "${PIPESTATUS[0]}") >&2 & eval "$pid_variable+=\" $!\"" } -- 2.39.5