Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This process is marked as <defunct> and kill -9 doesn't kill it. What can I do? Why can't this process be killed?

share|improve this question

migrated from stackoverflow.com Nov 25 '11 at 17:56

This question came from our site for professional and enthusiast programmers.

    
You cannot kill it because it is already dead. That's why it's called a zombie. ("defunct" is much less descriptive) –  William Pursell Nov 25 '11 at 18:27

2 Answers 2

Defunct means, that it's a zombie process - it's not really working, it just awaits it's parent process to call wait to receive it's return value.

wait function can be used to read the number of a signal, that killed the zombie process, so it's in fact the correct behavior.

To get rid of zombies you can: - kill the parent process (maybe console, where you typed in your command) - call wait in parent process - ignore SIGCHLD in the parent process, if you never call wait

share|improve this answer

This kind of a process is called a zombie process. Kill command has no effect on zombie processes. Technically, they are dead, and you see them just because they still have an entry in the process table.

To remove zombies from a system, the SIGCHLD signal can be sent to the parent manually, using the kill command. If the parent process still refuses to reap the zombie, the next step would be to remove the parent process. When a process loses its parent, init becomes its new parent. Init periodically executes the wait system call to reap any zombies with init as parent.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.