Can't cleanup a zombie process whose parent is init

jaeyong picture jaeyong · Dec 12, 2013 · Viewed 10.9k times · Source

I have a zombie process:

$ ps aux | grep Zl
root      6641  122  0.0  0 0 ? Zl   08:57 371:10 [ovs_dpdk] <defunct>

And, its parent looks like init

$ pstree
init─┬─acpid
     ├─atd
     ├─cron
     ├─dbus-daemon
     ├─dnsmasq
     ├─6*[getty]
     ├─irqbalance
     ├─libvirtd───10*[{libvirtd}]
     ├─ovs_dpdk───{ovs_dpdk}               <==== here
     ├─rpc.idmapd

But, kill -9 does not kill him...

sudo kill -9 6641

I'm stumped here, any help?

Answer

khoxsey picture khoxsey · Dec 12, 2013

You cannot kill a zombie because it is already dead. :-)

Seriously, a zombie process has already exited, so there is nothing to kill. Its entry in the process table is hanging around until the parent that created the (now dead) child sees the exit status.

Wikipedia (who else?) has a great discussion of this.

You can remove the process entry with SIGCHLD by telling its parent to reap the dead child:

kill -s SIGCHLD PPID

where PPID is the parent process ID. ht the xmodulo folks