Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | ############################################################# |
michael@0 | 2 | # script to watch for cores during QA runs, so they won't overwrite one |
michael@0 | 3 | # another |
michael@0 | 4 | # Not activated for efficiency reasons, and problems on MKS, us |
michael@0 | 5 | # only when needed and remember to remove afterwards |
michael@0 | 6 | ############################################################# |
michael@0 | 7 | |
michael@0 | 8 | ############################################################# |
michael@0 | 9 | # to activate put the following into all.sh (after the HOSTDIR |
michael@0 | 10 | # has been exported |
michael@0 | 11 | ############################################################# |
michael@0 | 12 | # sh `dirname $0`/core_watch $HOSTDIR ${HOSTDIR} & |
michael@0 | 13 | # CORE_WATCH_PID=$! |
michael@0 | 14 | # if [ -n "${KILLPIDS}" ] |
michael@0 | 15 | # then |
michael@0 | 16 | # echo $CORE_WATCH_PID >>"${KILLPIDS}" |
michael@0 | 17 | # fi |
michael@0 | 18 | ############################################################# |
michael@0 | 19 | |
michael@0 | 20 | ############################################################# |
michael@0 | 21 | # or put the following into nssqa to watch the whole RESULTDIR |
michael@0 | 22 | # start it shortly before run_all |
michael@0 | 23 | # |
michael@0 | 24 | # NOTE: the more efficient way is above, this is potentially going |
michael@0 | 25 | # thru 1000ds of files every 30 seconds |
michael@0 | 26 | ############################################################# |
michael@0 | 27 | # sh `dirname $0`/core_watch $RESULTDIR & |
michael@0 | 28 | # echo $! >>"${KILLPIDS}" #so Exit() can hopefully kill the core_watch |
michael@0 | 29 | ############################################################# |
michael@0 | 30 | |
michael@0 | 31 | # in both cases remember to kill the process when done, since |
michael@0 | 32 | # the PIDs that end up in ${KILLPIDS} might not work for all OS |
michael@0 | 33 | # something like "kill_by_name core_watch |
michael@0 | 34 | |
michael@0 | 35 | echo $$ >>"${KILLPIDS}" #so Exit() can hopefully kill this shell |
michael@0 | 36 | while [ 1 ] |
michael@0 | 37 | do |
michael@0 | 38 | for w in `find $1 -name "core" -print` |
michael@0 | 39 | do |
michael@0 | 40 | echo "Found core $w" |
michael@0 | 41 | mv $w $w.`date +%H%M%S` |
michael@0 | 42 | done |
michael@0 | 43 | sleep 30 |
michael@0 | 44 | done |
michael@0 | 45 |