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/
因为进程的父pid是init(1),所以除了重启之外你不能做任何事情. https://unix.stackexchange.com/questions/11172/how-can-i-kill-a-defunct-process-whose-parent-is-init
我无法测试这个,但是这个人说你可以摆脱这样一个已经失效的过程: 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? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |