From: Loic Dachary Date: Wed, 25 Dec 2013 20:36:13 +0000 (+0100) Subject: mon: osd-pool-create must not loop forever on kill X-Git-Tag: v0.75~31^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6d876aa5fb5e9d041867341eea7ece98d47f816;p=ceph.git mon: osd-pool-create must not loop forever on kill Looping forever on kill does not serve any useful purpose. Reduce the verbosity of the exit trap to help diagnose error conditions. Signed-off-by: Loic Dachary --- diff --git a/src/test/mon/osd-pool-create.sh b/src/test/mon/osd-pool-create.sh index 9f58f00bd818..35cfd409ced3 100755 --- a/src/test/mon/osd-pool-create.sh +++ b/src/test/mon/osd-pool-create.sh @@ -19,7 +19,7 @@ PS4='$LINENO: ' DIR=osd-pool-create rm -fr $DIR -trap "kill_mon || true ; rm -fr $DIR" EXIT +trap "set +x ; kill_mon || true ; rm -fr $DIR" EXIT mkdir $DIR export CEPH_ARGS="--conf /dev/null --auth-supported=none --mon-host=127.0.0.1" @@ -40,7 +40,14 @@ function run_mon() { } function kill_mon() { - while [ -f $DIR/pidfile ] && kill $(cat $DIR/pidfile) ; do sleep 1 ; done + for try in 0 1 1 1 2 3 ; do + if [ ! -e $DIR/pidfile ] || + ! kill $(cat $DIR/pidfile) ; then + break + fi + sleep $try + done + rm -fr $DIR/store.db }