diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-25 13:51:39 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-25 13:51:39 -0400 |
commit | 2ca01398bd12a1a9bdcfa570c8a2c26902c2c610 (patch) | |
tree | 66dd24be9e7aa4f0cb2c88d44e483a18fbc0c96d | |
parent | e2e6a4a2d630be3649586acd62e9b267fed2472d (diff) |
working upscore_wrapper.sh
Score wrapper essentially does a few things
1) backgrounds score_mers.py
2) creates an intercept for any Ctrl+C
3) waits for score_mers.py to finish
4) if there's an intercept, send a SEGV to the process and try and exit
it works, it might be dirty, you might see some output... but still at
least you can exit now
-rwxr-xr-x | src/score_wrapper.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/score_wrapper.sh b/src/score_wrapper.sh index 8a5beb1..4e1a6bd 100755 --- a/src/score_wrapper.sh +++ b/src/score_wrapper.sh @@ -2,15 +2,17 @@ function clean_exit { - - kill -s 9 $pid + echo -e "\nInterrupt caught. Exiting cleanly..." + echo "killing $pid" + kill -11 $pid + sleep 1 exit } -trap clean_exit SIGHUP SIGINT +trap clean_exit SIGINT echo "score_mers.py $1 $2 $3 $4 &" -score_mers.py $1 $2 $3 $4 +score_mers.py $1 $2 $3 $4 & </dev/null pid=$! wait $pid |