我在前台启动了程序(守护程序),用“kill -9”杀死了它,但剩下了一个僵尸,用“kill -9”无法杀死它。如何杀死僵尸进程?
如果僵尸是一个死进程(已经杀死),我如何从ps aux的输出中删除它?
root@OpenWrt:~# anyprogramd &
root@OpenWrt:~# ps aux | grep anyprogram
1163 root 2552 S anyprogramd
1167 root 2552 S anyprogramd
1169 root 2552 S anyprogramd
1170 root 2552 S anyprogramd
10101 root 944 S grep anyprogram
root@OpenWrt:~# pidof anyprogramd
1170 1169 1167 1163
root@OpenWrt:~# kill -9 1170 1169 1167 1163
root@OpenWrt:~# ps aux |grep anyprogram
1163 root 0 Z [anyprogramd]
root@OpenWrt:~# kill -9 1163
root@OpenWrt:~# ps aux |grep anyprogram
1163 root 0 Z [anyprogramd]
在http://www.linuxquestions.org/questions/suse-novell-60/howto-kill-defunct-processes-574612/找到它
2)这里有一个来自另一个用户(谢谢Bill Dandreta)的好建议:
有时
kill -9 <pid>
不会终止进程。运行
ps -xal
第四个字段是父进程,杀死僵尸的所有父母和僵尸死亡!
例子
4 0 18581 31706 17 0 2664 1236 wait S ? 0:00 sh -c /usr/bin/gcc -fomit-frame-pointer -O -mfpmat
4 0 18582 18581 17 0 2064 828 wait S ? 0:00 /usr/i686-pc-linux-gnu/gcc-bin/3.3.6/gcc -fomit-fr
4 0 18583 18582 21 0 6684 3100 - R ? 0:00 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/cc1 -quie
18581、18582、18583都是僵尸
kill -9 18581 18582 18583
没有效果。
kill -9 31706
移除僵尸。
在http://www.linuxquestions.org/questions/suse-novell-60/howto-kill-defunct-processes-574612/找到它
2)这里有一个来自另一个用户(谢谢Bill Dandreta)的好建议:
有时
kill -9 <pid>
不会终止进程。运行
ps -xal
第四个字段是父进程,杀死僵尸的所有父母和僵尸死亡!
例子
4 0 18581 31706 17 0 2664 1236 wait S ? 0:00 sh -c /usr/bin/gcc -fomit-frame-pointer -O -mfpmat
4 0 18582 18581 17 0 2064 828 wait S ? 0:00 /usr/i686-pc-linux-gnu/gcc-bin/3.3.6/gcc -fomit-fr
4 0 18583 18582 21 0 6684 3100 - R ? 0:00 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/cc1 -quie
18581、18582、18583都是僵尸
kill -9 18581 18582 18583
没有效果。
kill -9 31706
移除僵尸。