diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-10-09 12:10:16 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-10-09 12:10:16 +0200 |
commit | e1044314972685b5caf2644393bc5f13e279e830 (patch) | |
tree | b8f39b08dd6eddf7a6bdb5690b9224fa380e4903 /bin | |
parent | 8c8420419cb7046373fdff07d6b786ab42599c33 (diff) | |
download | jenkins.debian.net-e1044314972685b5caf2644393bc5f13e279e830.tar.xz |
reproducible: actually kill processes found
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_maintenance.sh | 10 |
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 |