just needed a place to put this script so i can find it easier, should i need to.
it kills zombie process's.
Code:#!/bin/sh kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`
just needed a place to put this script so i can find it easier, should i need to.
it kills zombie process's.
Code:#!/bin/sh kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`
It doesn't kill them all ;(
1
Last edited by kerry_s; August 20th, 2008 at 01:37 AM.
Ubuntu 8.04 sucks!!! Way too CPU intensive --
and what the hell is a zombie shell doing on install?
BUSTED!!!!!
no real answers on this one - --
G4:
I'm looking forward to your improved Ubuntu release/derivate
A torn jacket is soon mended; but hard words bruise the heart of a child.
~ H. W. Longfellow (1807-1882)
Yes, it does.
Ubuntu 11.04 has reported at least 3 zombie processes. Reported in here :
https://bugs.launchpad.net/ubuntu/+s...st/+bug/753984
and https://bugs.launchpad.net/ubuntu/+s...st/+bug/739780
It seems that the problem with the script is the column in which awk works (I think the only thing it's done with awk is print though)
Coming to my point you can first find the parent of the zombie process. Like this :
ps -fe | grep defunct
that will show you the zombie processes without the header: UID PID PPID C STIME TTY TIME CMD. So that the third column is the parent.
Now you can check the children of the process with:
ps -fe | awk '$3==2372 { print $0}'
Where 2372 was the parent of the zombie process, or change to column $2 to check the parent name.
If you still decide to go on you will have to kill the parent.... (also mix all the command in one line)
Last edited by leonbravo; June 23rd, 2011 at 02:23 AM.
Didn't mean to stir up trouble. Yes I did notice the date. I just make it a habit of placing echoes in scripts. Especially anything that does kills, removing, etc.
I agree that zombies are a rare thing nowadays, but I came across 2 in 10.10 that I wanted to research different removal methods.
Again I meant nothing negative in my comment. I actually used it.
A torn jacket is soon mended; but hard words bruise the heart of a child.
~ H. W. Longfellow (1807-1882)
Bookmarks