Wednesday 22 February 2023

How to identify and kill zombie/defunct processes in Linux without reboot.

 How to identify and kill zombie/defunct processes in Linux without reboot:

1) Identify the zombie processes

#top -b1 -n1 | grep Z

2) Find the parent of zombie processes

#ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }' | uniq | xargs ps -p

3) Send SIGCHLD signal to the parent process. This signal tells the parent process to execute the wait() system call and clean up its zombie children

#kill -s SIGCHLD ppid

4) Again Identify if the zombie processes have been killed

#top -b1 -n1 | grep Z

5) Kill the parent process

#kill -9 ppid

No comments:

Post a Comment