linux - 无法清除父级为 init 的僵尸进程

标签 linux kill zombie-process

我有一个僵尸进程:

$ ps aux | grep Zl
root      6641  122  0.0  0 0 ? Zl   08:57 371:10 [ovs_dpdk] <defunct>

而且,它的父级看起来像 init

$ pstree
init─┬─acpid
     ├─atd
     ├─cron
     ├─dbus-daemon
     ├─dnsmasq
     ├─6*[getty]
     ├─irqbalance
     ├─libvirtd───10*[{libvirtd}]
     ├─ovs_dpdk───{ovs_dpdk}               <==== here
     ├─rpc.idmapd

但是,kill -9 并没有杀死他...

sudo kill -9 6641

我在这里被难住了,有什么帮助吗?

最佳答案

你不能杀死僵尸,因为它已经死了。 :-)

说真的,一个僵尸进程已经退出了,所以没有什么可杀死的。它在进程表中的条目一直存在,直到创建(现已死亡) child 的 parent 看到退出状态。

Wikipedia (who else?) has a great discussion of this .

您可以使用 SIGCHLD 通知其父进程收割死掉的子进程来删除进程条目:

kill -s SIGCHLD PPID

其中 PPID 是父进程 ID。 ht the xmodulo folks

关于linux - 无法清除父级为 init 的僵尸进程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20535438/

相关文章:

c - 僵尸进程在代码中创建,并在另一部分中被杀死

linux - undefined symbol 引用/..libdl.so.2 : error adding symbols: DSO missing from command line

linux - NTPD : how to protect the connection of client with a Symmetric key?

linux - killall 命令会杀死哪些程序?

linux - sudo 忽略从同一脚本发送的 SIGTERM

python/django 生成后台进程并避免僵尸进程

linux - 错误 : possibly undefined macro: AS_IF

linux - Docker 容器可以在 Ubuntu 上运行,但无法在 MacOS 上运行

windows - 如果 Windows 中存在进程则终止

c - 通过处理程序收割僵尸进程