Messages in this thread | | | Date | Wed, 3 Nov 2004 18:49:44 +0100 | From | DervishD <> | Subject | Re: is killing zombies possible w/o a reboot? |
| |
Hi Måns :)
* Måns Rullgård <mru@inprovide.com> dixit: > >> >> I'd tried to kill the zombie earlier but couldn't. > >> >> Isn't there some way to clean up a &^$#^#@)_ zombie? > >> > Kill the parent, is the only (portable) way. > >> Perhaps not as portable, but another possible, though slightly > >> complicated, way is to ptrace the parent and force it to wait(). > > Or write a little program that just 'wait()'s for the specified > > PID's. That is perfectly portable IMHO. But I must admit that the > > preferred way should be killing the parent. 'init' will reap the > > children after that. > You can only wait() for your own children.
Yes, you will receive 'ECHILD', I didn't remember that, sorry. Anyway, you shouldn't need to do that, since those zombies should have been reparented to 'init'.
But, since SUSv3 doesn't specify which PID should be the parent when doing the reparenting, PID 0 could be used when reparenting as a way of telling the kernel "hey, rip those processes". Anyway, since the kernel does the reparenting, the kernel could get rid of zombies. I don't really know why is 'init' (PID 1) responsible of this.
Raúl Núñez de Arenas Coronado
-- Linux Registered User 88736 http://www.dervishd.net & http://www.pleyades.net/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |