We can list zombie processes by using the ps command and piping its output into egrep command. Zombie processes have a state flag of "Z," and you'll usually also see "defunct."
Type the following command on a terminal:
ps aux | egrep "Z|defunct"
The zombie process will be listed and you can also see the program that spawned these zombies.
Once we have the process ID of the first zombie, we need to find the process ID of its parent process. We can do so by using ps again. We'll use the output option (-o) to tell ps to display only the parent's process ID, and then pass it with the ppid= flag.
The process we want to find will be indicated by using the -p (process) option, and then passing in the zombie's process ID.
Therefore, we type the following command to look up the process information for process with ID = 7641, and it will only report the ID of the parent process:
ps -o ppid= -p 7641
The output of the command will be the ID of the parent process then you can use the kill command to terminate the parent process if that is safe to do and the zombie process will go away.
Taken from: https://www.howtogeek.com/701971/how-to-kill-zombie-processes-on-linux/
No comments:
Post a Comment