I have a defunct process on my system:
abc 22093 19508 0 23:29 pts/4 00:00:00 grep ProcA abc 31756 1 0 Dec08 ? 00:00:00 [ProcA_my_collect] <defunct>
How can I kill the above process, without a reboot of the machine? I have tried with
kill -9 31756 sudo kill -9 31756
A zombie is already dead, so you cannot kill it. To clean up a zombie, it must be waited on by its parent, so killing the parent should work to eliminate the zombie. (After the parent dies, the zombie will be inherited by pid 1, which will wait on it and clear its entry in the process table.)
Terminating a Process using kill Command You can use either the ps or pgrep command to locate the PID of the process. Also, you can terminate several processes at the same time by entering multiple PIDs on a single command line. Lets see an example of kill command. We would kill the process 'sleep 400' as shown below.
You have killed the process, but a dead process doesn't disappear from the process table until its parent process performs a task called "reaping" (essentially calling wait(3)
for that process to read its exit status). Dead processes that haven't been reaped are called "zombie processes."
The parent process id you see for 31756 is process id 1, which always belongs to init
. That process should reap its zombie processes periodically, but if it can't, they will remain zombies in the process table until you reboot.
Did you check for a child process that may need to be killed first? Sometimes the jam up is down the line... Try ps -ef --forest
to see what may be below it (if anything) then kill that first, then the one you already know about
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With