Linux 进程kill -9 无法杀死解决方案

从下述案例中可以看到使用kill -9 28051并未将28051进程杀死 

[root@iZufxxxxxxxxxxxx2tnZ devops-xxl-job]# kill -9 28051
[root@iZufxxxxxxxxxxxx2tnZ devops-xxl-job]# jps
28051 Launcher
29247 Jps
[root@iZufxxxxxxxxxxxx2tnZ devops-xxl-job]# jps
28051 Launcher
29539 Jps
[root@iZufxxxxxxxxxxxx2tnZ devops-xxl-job]# cd /proc/28051
[root@iZufxxxxxxxxxxxx2tnZ 28051]# jps
28051 Launcher
29582 Jps
[root@iZufxxxxxxxxxxxx2tnZ 28051]# cat status
Name:   java
State:  Z (zombie)
Tgid:   28051
Ngid:   0
Pid:    28051
PPid:   28000
TracerPid:      0
Uid:    0       0       0       0
Gid:    0       0       0       0
FDSize: 0
Groups: 0 
Threads:        1
SigQ:   3/31202
SigPnd: 0000000000000000
ShdPnd: 0000000000004100
SigBlk: 0000000000000000
SigIgn: 0000000000000000
SigCgt: 2000000181005ccf
CapInh: 0000000000000000
CapPrm: 0000001fffffffff
CapEff: 0000001fffffffff
CapBnd: 0000001fffffffff
CapAmb: 0000000000000000
Seccomp:        0
Speculation_Store_Bypass:       vulnerable
Cpus_allowed:   f
Cpus_allowed_list:      0-3
Mems_allowed:   00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list:      0
voluntary_ctxt_switches:        19
nonvoluntary_ctxt_switches:     2
[root@iZufxxxxxxxxxxxx2tnZ 28051]# kill -9 28000

杀不掉的原因有两种:

 1.这个进程是僵尸进程 2.此进程是"核心态"进程

解决方案:

1、进入到“/proc/进程号”目录下,执行“cat status”命令可以查询到指定进程的父进程

Linux 进程kill -9 无法杀死解决方案_第1张图片

2、利用“kill -9 父进程的进程号”将父进程给删除掉;

3、利用“kill 进程号”重新删除指定进程即可

你可能感兴趣的:(运维,linux,服务器)