Centos system kills zombie process
Ps-A-o stat,ppid,pid,cmd | grep-e'^ [Zz]'| awk'{print $2}'| xargs kill-9
Locate the zombie process and the parent of the zombie process
Ps-A-ostat,ppid,pid,cmd | grep-e'^ [Zz]'
Use the Kill-HUP zombie process ID to kill the zombie process. Often, this situation cannot kill the zombie process, so you need to kill the parent process of the zombie process.
Kill-HUP zombie process parent ID
Then use the above statement to query whether the zombie process has been killed
Ps-A-ostat,ppid,pid,cmd | grep-e'^ [Zz]'
Parameter interpretation
The-A parameter lists all processes
-o Custom output fields stat (status), ppid (process parent id), pid (process id), cmd (command)
Because the process with state z or Z is a zombie process, we use grep to grab the stat state as the zZ process