Defunct process

From LinuxReviews

Jump to: navigation, search

A "defunct" process (sometimes referred to as "zombie") is a process that is actually finished which depends on a parent process which for some reason (=error) has not accepted the knowledge that is is finished and should be terminated.

How to get rid of them

Defunct processes will sometimes show up in the process list (top and ps -aux). Many people, including myself, find these annoying. Adittionally, the reason for processes to be lisetd as defunct is that something has gone wrong with the parent process.

The solution is to find out what parent process the defunct processes belong to and stop it (or restart it).

The long story

Unix manages an explicit parent-child relationships between processes (Windows does not do this).

When a child process dies, the parent process recieves a notification. It is then the duty of the parent process to explicitly take notice of the childs demise by using the wait() system call.

The return value of the wait() is the process ID of the child, which gives the parent exact control about which of its children are still alive.

As long as the parent hasn't called wait(), the system needs to keep the dead child in the global process list, because that's the only place where the process ID is stored. The purpose of the "zombies" is really just for the system to remember the process ID, so that it can inform the parent process about it on request.

If the parent "forgets" to collect on its children, then the zombie will stay undead forever.

Well, almost forever. If the parent itself dies, then "init" (the system process with the ID 0) will take over fostership over its children and catch up on the neglected parental duties. This is why you need to identify the parent process and stop or restart it in order to get rid of defunct processes.

 
Personal tools
Privacy policy
linux events
ipv6
Linux Reviews
IPv6

Search:

linux newz | random page | poetry | free blog | adult dating

You are using a insecure IPv4 connection. Click here to enable SSL encryption..
You can also connect secure and anonymously if you are using Tor.