Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't cleanup a zombie process whose parent is init

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?

like image 351
jaeyong Avatar asked Oct 03 '22 04:10

jaeyong


1 Answers

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

like image 103
khoxsey Avatar answered Oct 13 '22 12:10

khoxsey