From 273c03b6663bae91ee9088cf12745660e3785c2b Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 19 Oct 2014 10:59:59 +0200 Subject: reproducible: notify about leftover processes --- bin/reproducible_housekeeping.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bin') diff --git a/bin/reproducible_housekeeping.sh b/bin/reproducible_housekeeping.sh index 717e0a23..18007dcb 100755 --- a/bin/reproducible_housekeeping.sh +++ b/bin/reproducible_housekeeping.sh @@ -53,3 +53,21 @@ if [ ! -z "$OLDSTUFF" ] ; then echo fi +# find processes which should not be there +HAYSTACK=$(mktemp) +RESULT=$(mktemp) +ps axo pid,user,size,pcpu,cmd > $HAYSTACK +for ZOMBIE in $(pgrep -u 1234 -P 1) ; do + # faked-sysv comes and goes... + grep ^$ZOMBIE $HAYSTACK | grep -v faked-sysv >> $RESULT 2> /dev/null +done +if [ -s $RESULT ] ; then + echo + echo "Warnung: processes found which should not be there:" + cat $RESULT + echo + echo "Please cleanup manually." + echo +fi +rm $HAYSTACK $RESULT + -- cgit v1.2.3-54-g00ecf