Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run top I see one line that doesn't look too good:

 2475 www-data  20   0     0    0    0 Z    1  0.0   0:00.19 apache2 <defunct> 

Why is this process <defunct> and what should I do about it?

(sorry, I'm new to this)

share|improve this question

3 Answers 3

up vote 4 down vote accepted

It is harmless. You can ignore it. It is a zombie process. The man page for ps has

Z    Defunct ("zombie") process, terminated but not reaped by its parent.

See also the Wikipedia page on Zombie process.

If you really want to get rid of it, restarting apache2 may do the trick. Rebooting the machine will certainly make it go away, but that is definitely not necessary.

This question is similar. - How can I kill a <defunct> process whose parent is init?

share|improve this answer

Defunct processes are zombie processes. The kill command has no effect on a zombie process. These can be killed by killing the parent process. You can find parent from the PPID value. If the PPID is 1(init) i.e. process is adapted by init as the parent is no more, then rebooting is the only solution.

share|improve this answer

You can send a SIGCHLD signal to the parent process instead of killing it. If parent process is registered with this signal and the wait system call is called, this defunct process will be removed.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com?utm_source=stackoverflow.com&amp;utm_medium=site-ui&amp;utm_campaign=footerlink\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.9.24.1889\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group. <br>This site is not affiliated with Linus Torvalds or The Open Group in an"], "copyright__copyright__copyright": ["ent is no more, then rebooting is the only solution.\n\nshare|improve this answer\n\nYou can send a SIGCHLD signal to the parent process instead of killing it. If parent process is registered with this signal and the wait system call is called, this defunct process will be removed.\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}