1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/tests/core_watch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +############################################################# 1.5 +# script to watch for cores during QA runs, so they won't overwrite one 1.6 +# another 1.7 +# Not activated for efficiency reasons, and problems on MKS, us 1.8 +# only when needed and remember to remove afterwards 1.9 +############################################################# 1.10 + 1.11 +############################################################# 1.12 +# to activate put the following into all.sh (after the HOSTDIR 1.13 +# has been exported 1.14 +############################################################# 1.15 +# sh `dirname $0`/core_watch $HOSTDIR ${HOSTDIR} & 1.16 +# CORE_WATCH_PID=$! 1.17 +# if [ -n "${KILLPIDS}" ] 1.18 +# then 1.19 +# echo $CORE_WATCH_PID >>"${KILLPIDS}" 1.20 +# fi 1.21 +############################################################# 1.22 + 1.23 +############################################################# 1.24 +# or put the following into nssqa to watch the whole RESULTDIR 1.25 +# start it shortly before run_all 1.26 +# 1.27 +# NOTE: the more efficient way is above, this is potentially going 1.28 +# thru 1000ds of files every 30 seconds 1.29 +############################################################# 1.30 +# sh `dirname $0`/core_watch $RESULTDIR & 1.31 +# echo $! >>"${KILLPIDS}" #so Exit() can hopefully kill the core_watch 1.32 +############################################################# 1.33 + 1.34 +# in both cases remember to kill the process when done, since 1.35 +# the PIDs that end up in ${KILLPIDS} might not work for all OS 1.36 +# something like "kill_by_name core_watch 1.37 + 1.38 +echo $$ >>"${KILLPIDS}" #so Exit() can hopefully kill this shell 1.39 +while [ 1 ] 1.40 +do 1.41 + for w in `find $1 -name "core" -print` 1.42 + do 1.43 + echo "Found core $w" 1.44 + mv $w $w.`date +%H%M%S` 1.45 + done 1.46 + sleep 30 1.47 +done 1.48 +