Linux如何殺掉殭屍程式

chenfeng發表於2017-06-05
執行top命令檢視:
[root@idb4 data]# top
top - 14:03:25 up 64 days, 20:47,  4 users,  load average: 3.79, 4.28, 3.74
Tasks: 610 total,   1 running, 608 sleeping,   0 stopped,   1 zombie
Cpu(s): 17.6%us,  1.2%sy,  0.0%ni, 81.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  65924464k total, 64499740k used,  1424724k free,    13512k buffers
Swap: 131071992k total,        0k used, 131071992k free, 15905380k cached

上面結果看到有1個zombie程式,代表殭屍程式。

[root@idb4 data]# ps -ef | grep defunct | more
gdm        3695   3694  0 Apr01 ?        00:00:00 [gconf-sanity-ch] <defunct>
root       8971 140945  0 14:02 pts/2    00:00:00 grep defunct


UID         PID   PPID …
—————————————————————


PPID就是父程式的pid號,本例為3694

可以使用kill -9 6757來殺掉父程式:

[root@idb4 data]# kill -9 3694 

然後透過ps -A | grep defunct驗證一下效果:


[root@idb4 data]# ps -ef | grep defunct 
root       9044 140945  0 14:02 pts/2    00:00:00 grep defunct

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2140291/,如需轉載,請註明出處,否則將追究法律責任。

相關文章