Klement Sekera | db4e84c | 2017-08-11 10:06:15 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [[ "$1" == "1" ]] |
| 4 | then |
| 5 | setsid scripts/run_in_venv_with_cleanup.sh $* |
Klement Sekera | db4e84c | 2017-08-11 10:06:15 +0200 | [diff] [blame] | 6 | else |
| 7 | setsid scripts/run_in_venv_with_cleanup.sh $* & |
| 8 | pid=$! |
| 9 | trap "echo setsid_wrapper.sh: got signal, killing child pid ${pid}; kill ${pid}; sleep .1;" SIGINT SIGTERM |
Klement Sekera | 8712ada | 2017-08-16 16:38:10 +0200 | [diff] [blame] | 10 | wait ${pid} |
| 11 | exit $? |
Klement Sekera | db4e84c | 2017-08-11 10:06:15 +0200 | [diff] [blame] | 12 | fi |