"You have to reboot to remove defunct processes"
You cannot remove them by 'kill'
If you're really concerned about them (if they are using CPU - yours appear not to be) you need to find out what is causing them in the first place. This explanation from Robert Wilson on comp.unix.aix
A <defunct> process is IBM's term for what has been traditionally known as
"zombie" processes (in UNIX anyway). A "zombie" makes more sense, since it
is literally an "undead" process. Specifically, a process forks a child, and
the child process completes execution before the parent. If the parent
doesn't perform a "wait()" on the child, the dead process will sit around in
the process table until the wait() is performed. As soon as the parent
either performs a wait(), or exits the <defunct>/zombie will go away (the
"init" process automatically performs a wait() on all children when the
parent dies).
<defunct> processes take up 0 (zero) system resources outside of a slot in
the process table (i.e., they do not use memory or CPU cycles). If you see
CPU cycles associated with a <defunct> process, they are probably the cycles
accumulated by the process prior to its death. If you see a <defunct>
process _still_accumulating_ CPU cycles, GET OUT OF THERE! They've come back
to life! ;-)
As Alex said, you can't kill defunct processes, only rebooting will get rid of them. Usually, they don't cause problems, but if you get a lot of them, they may. If these are the only defunct processes, I'd say you are probably a long way from having problems.
Take a look at this thread for more explanation of defunct processes: thread52-96153
A process is marked <defunct> when it has exited, but its parent has not acknowledged the fact. The PPID field in your ps listing indicates the parent process's id. If the parent is defunct, check its parent, and so forth.
Once you find an ancestor that is not defunct, exiting that process should clear out the defunct children. If that ancestor turns out to be process number 1 (/etc/init), then you will have to reboot to clear them out.
Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
baanman, your script works because you kill the parent. the zombie's processID is $2, you are murdering $3. you also (probably inadvertently) only kill defuncts created "yesterday": there is one less field in the ps -ef list for today's processes.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.