You are not logged in.
The actual problem is that I have 1000s of processes, each giving the following from ps aux:
root 664 0.0 0.0 0 0 ? Z 2008 0:01 [ php ] <defunct>
And the following error pops up randomly while trying to work - as a result of being out of of file descriptors (? or something like that):
bash: fork: Resource temporarily unavailable
From what I understand, there's a (small) chance I can kill all of these processes with a kill -9 {}, however it isn't working.
I assume its because these processes are zombies and can't be killed directly so I'd like to try killing their parent first. A ps aux seems to take ages and I'd like to know if there's a way from the bash prompt to find out which is the parent process that originally spawned all these defunct processes. I'm hoping that a pstree > treelist.txt isn't the easiest option - coz that might take ages.
Can someone please point me in the right direction?
Last edited by zatricky (2009-01-05 20:49:53)
pacman russian roulette: yes | pacman -Rcs $(pacman -Q | LANG=C sort -R | head -n $((RANDOM % 10)))
(yes, I know its broken)
Offline
try: cat /proc/<defunct pid>/status | grep PPid
Offline
Aha!
Its a cacti server btw. The parent was spine. When I killed spine then the php processes disappeared in a flash.
Thank you so much.
[root@cacti ~]# ps aux | grep php | grep defunct
....
....
root 480 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 481 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 482 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 483 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 484 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 485 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 486 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 487 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
root 488 0.0 0.0 0 0 ? Z 2008 0:01 [php] <defunct>
....
....
[root@cacti ~]# cat /proc/480/status | grep PPid
PPid: 26342
[root@cacti ~]# cat /proc/26342/status | grep Name
Name: spine
[root@cacti ~]# killall spine
[root@cacti ~]# ps aux | grep php | grep defunct
[root@cacti ~]#
pacman russian roulette: yes | pacman -Rcs $(pacman -Q | LANG=C sort -R | head -n $((RANDOM % 10)))
(yes, I know its broken)
Offline