Saturday, October 31, 2009

How to Kill Defunct Process in Unix

Tech Blog - A "defunct" process or a zombie process is a process that is actually finished which depends on a parent process, which for some reason usually due to error did not terminate.

You can usually see defunct process using the ps -ef command, this process mostly are harmless and can be left alone, however they are annoying in my opinion so I often want them removed, the catch is you can't kill an already dead process, good thing Unix has a utility that will help us removed it.

preap forces the parent of the process specified by pid to waitidfor pid, if pid represents a defunct process.

preap attempts to prevent the administrator from unwisely reaping a child process which might soon be reaped by the parent, if:

The process is a child of init.
The parent process is stopped and might wait on the child when it is again allowed to run.
The process has been defunct for less than one minute.

Using preap

$ preap pid

Below are some howto on troubleshooting

No comments:

For suggestion and concerns E-mail