The chrome browser was not responsive and I tried to kill it, but instead of disappearing the process had <defunct>
at its right, and didn't get killed:
What is <defunct>
for a process and why it doesn't it get killed?
The chrome browser was not responsive and I tried to kill it, but instead of disappearing the process had <defunct>
at its right, and didn't get killed:
What is <defunct>
for a process and why it doesn't it get killed?
From your output we see a "defunct", which means the process has either completed its task or has been corrupted or killed, but its child processes are still running or these parent process is monitoring its child process. To kill this kind of process, kill -9 PID doesn't work. You can try to kill them with this command but it will show this again and again.
Determine which is the parent process of this defunct process and kill it. To know this run the command:
Then
kill -9 637 27872
, then verify the defunct process is gone byps -ef | grep defunct
.Manual page ps(1) says:
You can't kill it because it is already dead. The only thing left is an entry in the process table:
There is no harm in letting such processes be unless there are many of them. Zombie is eventually reaped by its parent (by calling
wait(2)
). If original parent hasn't reaped it before its own exit theninit
process (pid == 1
) does it at some later time. Zombie Process is just:expanding on Paddington's answer..
From your output we see a defunct, which means this child process has either completed its task or has been corrupted or killed. Its parent process is still running and has not noticed its dead child.
kill -9 PID
won't work (already dead).To determine the parent of this child process, run this command:
ps -ef | grep defunct
See who the parent is:
ps ax | grep 27872
If you want you can kill the parent, and the defunct will go away.
kill -9 27872
see Jfs answer for a more technical reasoning.
I accidently create
<defunct>
processes bySolution is to try the command
fg
in every open terminal window. Then the defunct processes disappear.Adding to @Paddington's answer, I added this function to my bashrc for quick checking:
It outputs something like:
Thank you Mike S. We took your line and wrote a script that will kill defunct processes whose parent is in.telnetd. We didn't want it to kill any parent process, just telnetd that we know is causing a problem and we'll run it multiple times to kill multiple ones if needed.
I had a libreoffice application zombie hanging with and 'Z'. and its PPID was 1 (because I had killed the calling application oosplash after LibreOffice wasn't responding anymore). However, no files were in use by the zombie. Still, the office icons were still on my desktop/taskbar.
I have managed to get the application (or process ID) cleaned up and being able to start libreoffice again without the need for a reboot:
First, I removed the .lock file in the ~/.config/libreoffice/ directory. (don't know if it is relevant, but just for completeness of what I did). Next I started libreoffice on another host (so under same login). Office started normally on this new host. At the same time: all the 'hanging' libreoffice icons were gone. Once 'Document recovery' was complete, I had closed all open documents and exited libreoffice on this new host. (Please note that the document files are on a fileserver that is accessible to both hosts.)
I restarted libreoffice on the original host and that went without problems and no need to reboot.
Maybe the recipe doesn't work all the time, maybe a coincidence with my host cleaning up the orphan process at precisely the same time, but I was lucky to avoid the reboot. Maybe it helps others as well. just give it a try.
Good luck!