gzip zombie / spawned from init
Hello!
I wrote an init replacement (cinit), which is now in the beta-phase. The only problem I do have currently is that when calling 'loadkeys dvorak' directly from init (without a shell or anything) it will leave behind a gzip zombie (which was forked by loadkeys).
Now my question is: Is that a problem of loadkeys or from my init and what could be the reasons that it's still there?
cinit forks() loadkeys and does waitpid() for it. There is no loadkeys zombie, only gzip.
Thanks for any input,
Nico
P.S.: Replying to me directly will result in a confirmation mail,
I'll read lkml directly anyhow.
Signature · 3 lines
Keep it simple & stupid, use what's available. Please use pgp encryption: 8D0E 27A4 is my id. http://nico.schotteli.us | http://linux.schottelius.org
Quoted 9 lines · Nico Schottelius
Hello!
I wrote an init replacement (cinit), which is now in the beta-phase. The only problem I do have currently is that when calling 'loadkeys dvorak' directly from init (without a shell or anything) it will leave behind a gzip zombie (which was forked by loadkeys).
Now my question is: Is that a problem of loadkeys or from my init and what could be the reasons that it's still there?
Not really a kernel issue but:
Yes and no. If a parent exits before its child, the child is reparented to init. loadkeys probably doesn't wait properly for gzip to finish.
Quoted 3 lines
cinit
forks()loadkeys and doeswaitpid()for it. There is no loadkeys zombie, only gzip.
Use waitpid(-1,...) or wait(...) to wait on all childeren in your init. gzip will become a child of cinit.
Groeten,
Bart
Signature · 1 line
Bart Hartgers - TUE Eindhoven - http://plasimo.phys.tue.nl/bart/contact/
Thanks for the fast answer, Bart.
Bart Hartgers [Tue, Jun 14, 2005 at 12:54:14PM +0200]:
Quoted 5 lines
Quoted 1 line · Nico Schottelius
[zombie in your head...]
Yes and no. If a parent exits before its child, the child is reparented to init. loadkeys probably doesn't wait properly for gzip to finish.
Ok, so I'll try to contact the loadkeys developer.
Quoted 5 lines
Quoted 2 lines
cinit
forks()loadkeys and doeswaitpid()for it. There is no loadkeys zombie, only gzip.Use
waitpid(-1,...)or wait(...) to wait on all childeren in your init. gzip will become a child of cinit.
Well, wait waitpid(-1, ...) cannot be used, as there are many other children (the system is booting up at the time the gzip process becomes a zombie).
Still you cleared this issue for me.
Nico
Signature · 3 lines
Keep it simple & stupid, use what's available. Please use pgp encryption: 8D0E 27A4 is my id. http://nico.schotteli.us | http://linux.schottelius.org
Quoted 15 lines · Bart Hartgers
Quoted 7 lines · Nico Schottelius
Hello!
I wrote an init replacement (cinit), which is now in the beta-phase. The only problem I do have currently is that when calling 'loadkeys dvorak' directly from init (without a shell or anything) it will leave behind a gzip zombie (which was forked by loadkeys). Now my question is: Is that a problem of loadkeys or from my init and what could be the reasons that it's still there?Not really a kernel issue but:
Yes and no. If a parent exits before its child, the child is reparented to init. loadkeys probably doesn't wait properly for gzip to finish.
Quoted 5 lines
Quoted 2 lines
cinit
forks()loadkeys and doeswaitpid()for it. There is no loadkeys zombie, only gzip.Use
waitpid(-1,...)or wait(...) to wait on all childeren in your init. gzip will become a child of cinit.
In fact, init must reap any zombies that are reparented to it. Otherwise, the system will sooner or later run out of PIDs. There are a lot of misbehaving programs out there, and even if they were all well-behaved, they could be killed before having waited for their children, leaving zombies behind.
Signature · 2 lines
Måns Rullgård [email protected]
Quoted 20 lines · On Tue, 14 Jun 2005, [iso-8859-1] Måns Rullgård wrote:
Quoted 18 lines · Bart Hartgers
Quoted 7 lines · Nico Schottelius
Hello!
I wrote an init replacement (cinit), which is now in the beta-phase. The only problem I do have currently is that when calling 'loadkeys dvorak' directly from init (without a shell or anything) it will leave behind a gzip zombie (which was forked by loadkeys). Now my question is: Is that a problem of loadkeys or from my init and what could be the reasons that it's still there?Not really a kernel issue but:
Yes and no. If a parent exits before its child, the child is reparented to init. loadkeys probably doesn't wait properly for gzip to finish.
Quoted 2 lines
cinit
forks()loadkeys and doeswaitpid()for it. There is no loadkeys zombie, only gzip.
Quoted 12 lines
Quoted 2 lines
Use
waitpid(-1,...)or wait(...) to wait on all childeren in your init. gzip will become a child of cinit.In fact, init must reap any zombies that are reparented to it. Otherwise, the system will sooner or later run out of PIDs. There are a lot of misbehaving programs out there, and even if they were all well-behaved, they could be killed before having waited for their children, leaving zombies behind.
Signature · 2 lines
Måns Rullgård [email protected]
Normally an init program will provide a SIGCHLD handler like:
void reaper(int sig)
{
while(wait3(&sig, WNOHANG, NULL) > 0)
;
}This will 'reap' and throw away the status of all dead children, preventing zombies.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.