[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: maintenance: also lists too old processes with uid 1111/2222/1234 (used for r-b builds)

Holger Levsen holger at moszumanska.debian.org
Thu Jun 11 19:21:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 018aa31aa87fa6ecadf989f7327cd7d34afe37cb
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Thu Jun 11 20:09:43 2015 +0200

    reproducible: maintenance: also lists too old processes with uid 1111/2222/1234 (used for r-b builds)
---
 bin/reproducible_maintenance.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 5a2a5ec..f5c6771 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="

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list