]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone/ceph-helpers.sh: log meaningful PIDs for run_in_background()
authorRonen Friedman <rfriedma@redhat.com>
Mon, 28 Dec 2020 08:47:02 +0000 (10:47 +0200)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 28 Dec 2020 08:47:02 +0000 (10:47 +0200)
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 <rfriedma@redhat.com>
qa/standalone/ceph-helpers.sh

index dbe004f8e19ea1a07f5b8c99a5397abfac76a4e5..c76c2f1b0e527b7d60d82097d6f3e30e93dce671 100755 (executable)
@@ -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+=\" $!\""
 }