summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-10-09 12:10:16 +0200
committerHolger Levsen <holger@layer-acht.org>2015-10-09 12:10:16 +0200
commite1044314972685b5caf2644393bc5f13e279e830 (patch)
treeb8f39b08dd6eddf7a6bdb5690b9224fa380e4903
parent8c8420419cb7046373fdff07d6b786ab42599c33 (diff)
downloadjenkins.debian.net-e1044314972685b5caf2644393bc5f13e279e830.tar.xz
reproducible: actually kill processes found
-rwxr-xr-xbin/reproducible_maintenance.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh
index 6dbc1b82..4215880b 100755
--- a/bin/reproducible_maintenance.sh
+++ b/bin/reproducible_maintenance.sh
@@ -287,13 +287,17 @@ for i in $PBUIDS ; 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"
- echo "Warning: Could 'kill -9 $p' now, but not doing so now _yet_... "
+ sudo kill -9 $p 2>&1 || (echo "Could not kill:" ; ps -F -p "$p")
+ # check it's gone
+ AGE=$(ps -p $p -o etimes= || echo 0)
+ if [ $AGE -gt $(( 14*60*60 )) ] ; then
+ PSCALL=${PSCALL:+"$PSCALL,"}"$p"
+ fi
fi
done
done
if [ ! -z "$PSCALL" ] ; then
- echo -e "Warning: processes found which should not be there, please fix up manually:"
+ echo -e "Warning: processes found which should not be there and which could not be killed. Please fix up manually:"
ps -F -p "$PSCALL"
echo
fi