From 2ca01398bd12a1a9bdcfa570c8a2c26902c2c610 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 25 Mar 2014 13:51:39 -0400 Subject: 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 --- src/score_wrapper.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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 &