Get the App
SLTechnology News&Howtos  ›  Servers  › 

Centos system kills zombie process

Shulou Source: shulou.com Published: 2022-06-02 08:34:03 10月03日 Update

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

Tags: Process zombie state parameter command field situation statement face location query output system Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MariaDB OPPO Reno Microsoft Shulou Tech Info