From e1044314972685b5caf2644393bc5f13e279e830 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 9 Oct 2015 12:10:16 +0200 Subject: reproducible: actually kill processes found --- bin/reproducible_maintenance.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/reproducible_maintenance.sh') 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 -- cgit v1.2.3-70-g09d2