From: Ronen Friedman Date: Mon, 28 Dec 2020 08:47:02 +0000 (+0200) Subject: qa/standalone/ceph-helpers.sh: log meaningful PIDs for run_in_background() X-Git-Tag: v16.1.0~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bb848cfd90d0e047b31b11d15674a6591255ccf6;p=ceph.git 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 --- diff --git a/qa/standalone/ceph-helpers.sh b/qa/standalone/ceph-helpers.sh index dbe004f8e19e..c76c2f1b0e52 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+=\" $!\"" }