linux – init不会杀死僵尸

linux – init不会杀死僵尸,第1张

概述我的系统上有一些僵尸进程.我已经杀死了那些僵尸的父母,希望init能够接管并释放资源(CLOSE_WAIT中有很多套接字).但是init不会从系统中删除这些过程: #ps ax...17051 ? Zl 8498:24 [impalad] <defunct>...# ps -o ppid= -p 17051 1 有没有办法在不重启的情况下移除僵尸? 更新: 我试 我的系统上有一些僵尸进程.我已经杀死了那些僵尸的父母,希望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 – init不会杀死僵尸全部内容,希望文章能够帮你解决linux – init不会杀死僵尸所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1034543.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存