Date: Tue, 30 May 2017 13:31:18 +0000 (UTC) From: Peter Holm <pho@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r319209 - user/pho/stress2/tools Message-ID: <201705301331.v4UDVIdJ013880@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pho Date: Tue May 30 13:31:18 2017 New Revision: 319209 URL: https://svnweb.freebsd.org/changeset/base/319209 Log: Improved error handling. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/tools/killall.sh Modified: user/pho/stress2/tools/killall.sh ============================================================================== --- user/pho/stress2/tools/killall.sh Tue May 30 13:30:26 2017 (r319208) +++ user/pho/stress2/tools/killall.sh Tue May 30 13:31:18 2017 (r319209) @@ -30,11 +30,24 @@ # Kill all running test programs from stress2/testcases -for i in `find ../testcases -type f -perm -1`; do - list=`echo $list $(basename $i)` -done +list="`find ../testcases -type f -perm -1 | xargs basename`" +[ -z "$list" ] && exit 1 -for i in `jot 20`; do - killall -q -9 $list 2>/dev/null || break - sleep $i +i=0 +while pkill -9 $list; do + [ $((i += 1)) -lt 3 ] && continue + if [ -z "$(ps `pgrep $list` | sed 1d)" ]; then # <defunct> + for j in "`pgrep $list`"; do + ps auxwwl | awk "\$2 == $j" + done + echo "$0 FAIL"; exit 2 + fi + if [ $i -eq 30 ]; then + pgrep $list | xargs ps -lp + echo "$0 FAIL @ $i" + exit 3 + fi + sleep 5 done +[ $i -gt 2 ] && echo "Note: $0 exit @ $i" +exit 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705301331.v4UDVIdJ013880>