how to kill a defunc/zombie process in linux

To solve this problem it's relatively easy, it think that you have already tried the conventional method kill -9 [psid] but it does not work so we can do as follow.

Find defunc process that you want to kill

The process that i had in defunc was adb so you need to change adb with you application. 

You have eighter the direct way by doing 

- ps -ef | grep adb

and you will get all realted pids or you can type 

- ps -ef | grep defunc

and you will get all the defunc apps and you have to know what is the one that you want to kill.

Doing like this i will have all the info of my process:

10537 ? 00:00:00 adb

What we are looking for is the first 5 in my case number that rapresents the pid.

Find the parent process

Now we have to find the parent process by simply typing:

- cat /proc/10537/status | grep -i ppid

obviously you have to change 10537 with the pid of your app, the one that you got before.

It will output:

PPid: 3439

Killing the parent process

We need to simply run the a kill process to this pid doing kill -9 3439 and we are done

linux zombie process process ps kill stuck process