svn commit: r279809 - user/pho/stress2

Peter Holm pho at FreeBSD.org
Mon Mar 9 14:01:36 UTC 2015


Author: pho
Date: Mon Mar  9 14:01:35 2015
New Revision: 279809
URL: https://svnweb.freebsd.org/changeset/base/279809

Log:
  Do not assume we have /dev/tty, check for console write access.
  
  Sponsored by:	 EMC / Isilon storage division

Modified:
  user/pho/stress2/run.sh

Modified: user/pho/stress2/run.sh
==============================================================================
--- user/pho/stress2/run.sh	Mon Mar  9 13:21:00 2015	(r279808)
+++ user/pho/stress2/run.sh	Mon Mar  9 14:01:35 2015	(r279809)
@@ -41,16 +41,19 @@ while getopts a name; do
 done
 shift $(($OPTIND - 1))
 
-. ./default.cfg
 if [ ! -z "$aflag" ]; then
+   . ./default.cfg
    export runRUNTIME=5m
    t1=`date '+%s'`
    while true;do
       for i in `ls *.cfg | grep -v default`; do
          t2=`date '+%s'`
          e=` date -u -j -f '%s' '+%T' $((t2 - t1))`
-         echo "`date '+%Y%m%d %T'` $i, elapsed $e" | tee /dev/tty >> /tmp/all.log
+         echo "`date '+%Y%m%d %T'` $i, elapsed $e"
+         echo "`date '+%Y%m%d %T'` $i, elapsed $e" >> /tmp/all.log
          logger "Starting test $i"
+         [ -w /dev/console ] &&
+            printf "`date '+%Y%m%d %T'` run $i\r\n" > /dev/console
          $0 $i
       done
       [ "`id -un`" = pho ] && ipcs | \


More information about the svn-src-user mailing list