diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-04-10 19:11:36 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-04-11 15:08:32 +0200 |
commit | 2952086e79e60e15bda8101dd9b6bd76af978aee (patch) | |
tree | 3a7a849d8a6c518d6b2c7d8d6041abacdcc7c35e | |
parent | 150aab14d2cba0db59d1b09ec6c053ac07462ad7 (diff) | |
download | jenkins.debian.net-2952086e79e60e15bda8101dd9b6bd76af978aee.tar.xz |
reproducible: maintenance: rework a bit the "find+terminate processes which should not be there" part to avoid logparse noise
-rwxr-xr-x | bin/reproducible_maintenance.sh | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 01c5f885..32ca96c5 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -119,6 +119,7 @@ fi # find+terminate processes which should not be there HAYSTACK=$(mktemp) RESULT=$(mktemp) +TOKILL=$(mktemp) PBUIDS="1234 1111 2222" ps axo pid,user,size,pcpu,cmd > $HAYSTACK for i in $PBUIDS ; do @@ -128,24 +129,27 @@ for i in $PBUIDS ; do done done if [ -s $RESULT ] ; then - echo - echo "Warning: processes found which should not be there, maybe killing them now:" - cat $RESULT - echo for PROCESS in $(cat $RESULT | cut -d " " -f1 | xargs echo) ; do AGE=$(ps -p $PROCESS -o etimes= || echo 0) # a single build may only take half a day, so... if [ $AGE -gt 43200 ] ; then - sudo kill -9 $PROCESS 2>&1 - echo "'kill -9 $PROCESS' done." - else - echo "Did not kill $PROCESS as it is only $AGE seconds old." + echo "$PROCESS" >> $TOKILL fi done - echo - DIRTY=true + if [ -s $TOKILL ] ; then + DIRTY=true + echo + echo "Warning: processes found which should not be there, killing them now:" + cat $TOKILL | xargs echo + echo + for PROCESS in $(cat $TOKILL | xargs echo) ; do + echo sudo kill -9 $PROCESS 2>&1 + #echo "'kill -9 $PROCESS' done." # FIXME re-enable once we're sure this new code is fine + done + echo + fi fi -rm $HAYSTACK $RESULT +rm $HAYSTACK $RESULT $TOKILL # find packages which build didnt end correctly QUERY=" |