X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fscripts%2Fsetsid_wrapper.sh;h=030c3b079de730b6ef1efcdd227b868ba7a248c9;hb=b23ffd7ef216463c35b75c831e6a27e58971f4ec;hp=6d63426becc08f6141eb167d9985c734e9e02f64;hpb=8ccc6b350703d3390633636d2b1c2f578f37cb21;p=vpp.git diff --git a/test/scripts/setsid_wrapper.sh b/test/scripts/setsid_wrapper.sh index 6d63426becc..030c3b079de 100755 --- a/test/scripts/setsid_wrapper.sh +++ b/test/scripts/setsid_wrapper.sh @@ -1,10 +1,15 @@ #!/bin/bash -if [[ "$1" == "1" ]] +cmd=$1 +force_foreground=$2 +shift +shift + +if [[ "$force_foreground" == "1" ]] then - setsid scripts/run_in_venv_with_cleanup.sh $* + setsid $cmd $force_foreground $* else - setsid scripts/run_in_venv_with_cleanup.sh $* & + setsid $cmd $force_foreground $* & pid=$! trap "echo setsid_wrapper.sh: got signal, killing child pid ${pid}; kill ${pid}; sleep .1;" SIGINT SIGTERM wait ${pid}