summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_maintenance.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-06-11 20:09:43 +0200
committerHolger Levsen <holger@layer-acht.org>2015-06-11 21:20:43 +0200
commit018aa31aa87fa6ecadf989f7327cd7d34afe37cb (patch)
tree4a33ebf7bd8e3ba3d87676fcbf63dd7fdac69711 /bin/reproducible_maintenance.sh
parenta385a48fe8981c2d3196c313544bdd474cc74d54 (diff)
downloadjenkins.debian.net-018aa31aa87fa6ecadf989f7327cd7d34afe37cb.tar.xz
reproducible: maintenance: also lists too old processes with uid 1111/2222/1234 (used for r-b builds)
Diffstat (limited to 'bin/reproducible_maintenance.sh')
-rwxr-xr-xbin/reproducible_maintenance.sh18
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="