diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_maintenance.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 5a2a5ec3..f5c67718 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -104,7 +104,7 @@ if [ -s $RESULT ] ; then 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 + if [ $AGE -gt $(( 12*60*60 )) ] ; then echo "$PROCESS" >> $TOKILL fi done @@ -126,6 +126,22 @@ if [ -s $RESULT ] ; then fi fi rm $HAYSTACK $RESULT $TOKILL +# There are naughty processes spawning childs and leaving them to their grandparents +PSCALL="" +for i in "$PBUIDS" ; do + for p in $(pgrep -u $i) ; do + AGE=$(ps -p $p -o etimes= || echo 0) + # let's be generous and consider 14 hours here... + if [ $AGE -gt $(( 14*60*60 )) ] ; then + PSCALL=${PSCALL:+"$PSCALL,"}"$p" + fi + done +done +if [ ! -z "$PSCALL" ] ; then + echo -e "Warning: processes found which should not be there, please fix up manually:" + ps -F -p "$PSCALL" + echo +fi # find packages which build didnt end correctly QUERY=" |