From 89b1c32b241a8d37a8d27fb8415105a96939a256 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 17 Sep 2020 21:03:52 +0900 Subject: [PATCH] Rework s3fs pid handling Previously S3FS_PID was not set in the correct shell and thus ps u $S3FS_PID showed all programs. This caused the flag detection to fail when users ran other instances of s3fs with different flags. References #1402. --- test/integration-test-common.sh | 9 ++++++--- test/integration-test-main.sh | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/integration-test-common.sh b/test/integration-test-common.sh index c4c0c4d..0c710bb 100644 --- a/test/integration-test-common.sh +++ b/test/integration-test-common.sh @@ -225,9 +225,12 @@ function start_s3fs { -o dbglevel=${DBGLEVEL:=info} \ -o retries=3 \ -f \ - "${@}" | stdbuf -oL -eL sed $SED_BUFFER_FLAG "s/^/s3fs: /" & - S3FS_PID=$! - ) + "${@}" & + echo $! >&3 + ) 3>pid | stdbuf -oL -eL sed $SED_BUFFER_FLAG "s/^/s3fs: /" & + sleep 1 + export S3FS_PID=$(