diff --git a/src/scripts/dbt2-run-workload b/src/scripts/dbt2-run-workload index b0e84bd..c9ab6d1 100755 --- a/src/scripts/dbt2-run-workload +++ b/src/scripts/dbt2-run-workload @@ -6,11 +6,6 @@ # Copyright The DBT-2 Authors # -trap 'echo "Test was interrupted by Control-C."; \ - killall dbt2-client dbt2-driver sar sadc pidstat; dbt2-${DBMS}-stop-db; killall dbt2-${DBMS}-db-stat sar sadc pidstat' INT -trap 'echo "Test was interrupted. Got TERM signal."; \ - killall dbt2-client dbt2-driver sar sadc pidstat; dbt2-${DBMS}-stop-db; killall dbt2-${DBMS}-db-stat sar sadc pidstat' TERM - do_sleep() { echo "Sleeping $1 seconds" @@ -314,6 +309,15 @@ readprofile_clear() ${COMMAND} sudo /usr/sbin/readprofile -r } +stop_processes() { + killall dbt2-client dbt2-driver sar sadc pidstat + "dbt2-${DBMS}-stop-db" + killall "dbt2-${DBMS}-db-stat" sar sadc pidstat +} + +trap 'echo "Test was interrupted by Control-C."; stop_processes' INT +trap 'echo "Test was interrupted. Got TERM signal."; stop_processes' TERM + usage() { if [ "$1" != "" ]; then