Merge pull request #34 from dod-ccpo/reap

Reap child processes
This commit is contained in:
briandds 2018-06-18 11:39:36 -04:00 committed by GitHub
commit b51955771f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,13 @@
#!/bin/bash #!/bin/bash
reap() {
kill -TERM $child
sleep 0.1
exit
}
trap reap TERM INT
# If a command fails, exit the script # If a command fails, exit the script
set -e set -e
@ -7,4 +15,7 @@ set -e
cd "$(dirname "${0}")/.." cd "$(dirname "${0}")/.."
# Launch the app # Launch the app
pipenv run python app.py ${@} pipenv run python app.py ${@} &
child=$!
wait $child