linux僵尸进程<defunct>

本文介绍了解决Linux系统中defunct僵尸进程的方法。defunct进程不仅占用系统资源,还可能导致系统性能下降甚至瘫痪。文章指出,直接使用kill-9通常无法杀死这类进程,正确的做法是先找到并终止其父进程。提供了查看父进程的命令,帮助读者有效解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

defunct进程不仅占用系统的内存资源,影响系统的性能,而且如果其数目太多,还会导致系统瘫痪。

使用kill -9 [进程ID]发现无法杀死僵尸进程。

解决方案:应该首先查看其父进程,然后再杀死该父进程。

查看父进程命令:

ps -ef | grep defunct | more

 

[root@xran-cudu0808-0 home]# ps aux | grep 'Z' USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 293 0.0 0.0 0 0 pts/0 Z< 02:21 0:00 [odsNameServer] <defunct> root 296 0.2 0.0 0 0 pts/0 Z< 02:21 0:05 [xranOamCtrl] <defunct> root 300 0.0 0.0 0 0 pts/0 Z 02:21 0:00 [python3] <defunct> root 317 0.0 0.0 0 0 pts/0 Z< 02:21 0:00 [pmon.sh] <defunct> root 390 0.1 0.0 0 0 pts/0 Z 02:21 0:02 [xranUpCtrl] <defunct> root 398 0.0 0.0 0 0 pts/0 Z< 02:21 0:01 [xranGnbCtrl] <defunct> root 407 0.0 0.0 0 0 pts/0 Z< 02:21 0:01 [xranCellCtrl] <defunct> root 452 0.0 0.0 0 0 pts/0 Z< 02:22 0:00 [xranProxyCtrl] <defunct> root 459 0.1 0.0 0 0 pts/0 Z 02:22 0:02 [xranDuCtrl] <defunct> root 1808 0.0 0.0 0 0 pts/0 Z< 02:25 0:00 [sleep] <defunct> root 2059 0.0 0.0 0 0 pts/0 Z< 02:34 0:00 [odsNameServer] <defunct> root 2062 0.3 0.0 0 0 pts/0 Z< 02:34 0:04 [xranOamCtrl] <defunct> root 2066 0.0 0.0 0 0 pts/0 Z 02:34 0:00 [python3] <defunct> root 2083 0.0 0.0 0 0 pts/0 Z< 02:34 0:00 [pmon.sh] <defunct> root 2156 0.1 0.0 0 0 pts/0 Z 02:34 0:02 [xranUpCtrl] <defunct> root 2164 0.0 0.0 0 0 pts/0 Z< 02:34 0:01 [xranGnbCtrl] <defunct> root 2173 0.0 0.0 0 0 pts/0 Z< 02:34 0:01 [xranCellCtrl] <defunct> root 2218 0.0 0.0 0 0 pts/0 Z< 02:34 0:00 [xranProxyCtrl] <defunct> root 2225 0.2 0.0 0 0 pts/0 Z 02:34 0:03 [xranDuCtrl] <defunct> root 4608 0.0 0.0 0 0 pts/0 Z< 02:38 0:00 [sleep] <defunct> root 4869 0.0 0.0 0 0 pts/0 Z< 02:38 0:00 [odsNameServer] <defunct> root 4872 0.4 0.0 0 0 pts/0 Z< 02:38 0:05 [xranOamCtrl] <defunct> root 4876 0.0 0.0 0 0 pts/0 Z 02:38 0:00 [python3] <defunct> root 4893 0.1 0.0 0 0 pts/0 Z< 02:38 0:01 [pmon.sh] <defunct> root 4961 0.7 0.0 0 0 pts/0 Z 02:38 0:08 [xranUpCtrl] <defunct> root 4974 0.1 0.0 0 0 pts/0 Z< 02:39 0:02 [xranGnbCtrl] <defunct> root 4983 0.2 0.0 0 0 pts/0 Z< 02:39 0:02 [xranCellCtrl] <defunct> root 5028 0.0 0.0 0 0 pts/0 Z< 02:39 0:00 [xranProxyCtrl] <defunct> root 5035 1.0 0.0 0 0 pts/0 Z 02:39 0:12 [xranDuCtrl] <defunct> root 17783 0.0 0.0 0 0 pts/0 Z< 02:52 0:00 [sleep] <defunct> root 22929 0.0 0.0 5756 1704 pts/2 S+ 02:58 0:00 grep --color=auto Z [root@xran-cudu0808-0 home]# ps -eo pid,ppid,stat,cmd | grep '^[[:space:]]*[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+Z' 293 1 Z< [odsNameServer] <defunct> 296 1 Z< [xranOamCtrl] <defunct> 300 1 Z [python3] <defunct> 317 1 Z< [pmon.sh] <defunct> 390 1 Z [xranUpCtrl] <defunct> 398 1 Z< [xranGnbCtrl] <defunct> 407 1 Z< [xranCellCtrl] <defunct> 452 1 Z< [xranProxyCtrl] <defunct> 459 1 Z [xranDuCtrl] <defunct> 1808 1 Z< [sleep] <defunct> 2059 1 Z< [odsNameServer] <defunct> 2062 1 Z< [xranOamCtrl] <defunct> 2066 1 Z [python3] <defunct> 2083 1 Z< [pmon.sh] <defunct> 2156 1 Z [xranUpCtrl] <defunct> 2164 1 Z< [xranGnbCtrl] <defunct> 2173 1 Z< [xranCellCtrl] <defunct> 2218 1 Z< [xranProxyCtrl] <defunct> 2225 1 Z [xranDuCtrl] <defunct> 4608 1 Z< [sleep] <defunct> 4869 1 Z< [odsNameServer] <defunct> 4872 1 Z< [xranOamCtrl] <defunct> 4876 1 Z [python3] <defunct> 4893 1 Z< [pmon.sh] <defunct> 4961 1 Z [xranUpCtrl] <defunct> 4974 1 Z< [xranGnbCtrl] <defunct> 4983 1 Z< [xranCellCtrl] <defunct> 5028 1 Z< [xranProxyCtrl] <defunct> 5035 1 Z [xranDuCtrl] <defunct> 17783 1 Z< [sleep] <defunct> [root@xran-cudu0808-0 home]# kill -s SIGCHLD 293 [root@xran-cudu0808-0 home]# kill -s SIGCHLD 293296 bash: kill: (293296) - No such process [root@xran-cudu0808-0 home]# kill -s SIGCHLD 296 [root@xran-cudu0808-0 home]# ps -eo pid,ppid,stat,cmd | grep '^[[:space:]]*[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+Z' 293 1 Z< [odsNameServer] <defunct> 296 1 Z< [xranOamCtrl] <defunct> 300 1 Z [python3] <defunct> 317 1 Z< [pmon.sh] <defunct> 390 1 Z [xranUpCtrl] <defunct> 398 1 Z< [xranGnbCtrl] <defunct> 407 1 Z< [xranCellCtrl] <defunct> 452 1 Z< [xranProxyCtrl] <defunct> 459 1 Z [xranDuCtrl] <defunct> 1808 1 Z< [sleep] <defunct> 2059 1 Z< [odsNameServer] <defunct> 2062 1 Z< [xranOamCtrl] <defunct> 2066 1 Z [python3] <defunct> 2083 1 Z< [pmon.sh] <defunct> 2156 1 Z [xranUpCtrl] <defunct> 2164 1 Z< [xranGnbCtrl] <defunct> 2173 1 Z< [xranCellCtrl] <defunct> 2218 1 Z< [xranProxyCtrl] <defunct> 2225 1 Z [xranDuCtrl] <defunct> 4608 1 Z< [sleep] <defunct> 4869 1 Z< [odsNameServer] <defunct> 4872 1 Z< [xranOamCtrl] <defunct> 4876 1 Z [python3] <defunct> 4893 1 Z< [pmon.sh] <defunct> 4961 1 Z [xranUpCtrl] <defunct> 4974 1 Z< [xranGnbCtrl] <defunct> 4983 1 Z< [xranCellCtrl] <defunct> 5028 1 Z< [xranProxyCtrl] <defunct> 5035 1 Z [xranDuCtrl] <defunct> 17783 1 Z< [sleep] <defunct> [root@xran-cudu0808-0 home]#
最新发布
08-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值