diff options
author | Randall Leeds <randall@apache.org> | 2011-11-30 22:40:41 -0800 |
---|---|---|
committer | Randall Leeds <randall@apache.org> | 2012-01-07 13:56:24 -0800 |
commit | 2921c7869411f338da036f893f5937178d1e823c (patch) | |
tree | 7c56d91e90dd4c4cfce0f82ae9f284b2ee7183f0 | |
parent | 8f0b4e64f38a9b337d84a9637692c6920ab2d114 (diff) | |
download | couchdb-2921c7869411f338da036f893f5937178d1e823c.tar.gz |
COUCHDB-1339 - stop couchdb on js cli exits
-rw-r--r-- | test/javascript/run.tpl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl index 593f9ed6c..caffe49fe 100644 --- a/test/javascript/run.tpl +++ b/test/javascript/run.tpl @@ -36,10 +36,19 @@ else fi make dev + +# stop CouchDB on exit from various signals +abort() { + trap - 0 + ./utils/run -d + exit 2 +} + # start CouchDB if [ -z $COUCHDB_NO_START ]; then - ./utils/run -b -r 1 - sleep 1 # give it a sec + trap 'abort' 0 1 2 3 4 6 8 15 + ./utils/run -b -r 1 + sleep 1 # give it a sec fi cat $SCRIPT_DIR/json2.js \ @@ -56,4 +65,5 @@ cat $SCRIPT_DIR/json2.js \ if [ -z $COUCHDB_NO_START ]; then # stop CouchDB ./utils/run -d + trap - 0 fi |