linux – init不会杀死僵尸

我的系统上有一些僵尸进程.我已经杀死了那些僵尸的父母,希望init能够接管并释放资源(CLOSE_WAIT中有很多套接字).但是init不会从系统中删除这些过程:
#ps ax
...
17051 ?        Zl   8498:24 [impalad] <defunct>
...

# ps -o ppid= -p 17051
    1

有没有办法在不重启的情况下移除僵尸?

更新:

我试过杀了-s SIGCHLD 1.它没有帮助.

解决方法

你不能杀死一个已经解散的过程.用别人的话说:

http://www.linuxquestions.org/questions/suse-opensuse-60/howto-kill-defunct-processes-574612/

You cannot kill a defunct process (a.k.a zombie) as it is already
dead. It doesn’t take any resources so it’s no big deal but if you
really want it to disappear form the process table you need to have
its parent procees reaping it. “pstree” should give you the process
hierarchy and “kill -1 ” is sometimes enough for the job.

因为进程的父pid是init(1),所以除了重启之外你不能做任何事情.

https://unix.stackexchange.com/questions/11172/how-can-i-kill-a-defunct-process-whose-parent-is-init

You cannot kill a (zombie) process as it is already dead.
The only reason why the system keeps zombie processes is to keep the
exit status for the parent to collect. If the parent does not collect
the exit status then the zombie processes will stay around forever.
The only way to get rid of those zombie processes are by killing the
parent. If the parent is init then you can only reboot.

我无法测试这个,但是这个人说你可以摆脱这样一个已经失效的过程:

What is a zombie process and how do I kill it?

There is already an accepted answer,however: you CAN kill the zombie process. Attach with the debugger to the parent process and call waitpid function. E.g.: - let's assume that the parent has PID=100,the zombie process has PID=200

$gdb -p 100
(gdb) call waitpid(200,0)
(gdb) quit

这个家伙在一个似乎继续运行的失效过程中遇到了问题.我不明白,但这里是链接.在这种情况下,杀死-9 pid声称可以工作.

Zombie processes still alive and working fine,but can’t be killed?

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...