mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mru@inprovide.com>
To: linux-kernel@vger.kernel.org
Subject: Re: gzip zombie / spawned from init
Date: Tue, 14 Jun 2005 13:32:33 +0200	[thread overview]
Message-ID: <yw1xvf4h6uni.fsf@ford.inprovide.com> (raw)
In-Reply-To: <42AEB756.2030809@etpmod.phys.tue.nl>

Bart Hartgers <bart@etpmod.phys.tue.nl> writes:

> Nico Schottelius wrote:
>> 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.
>
>> cinit forks() loadkeys and does waitpid() 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.

-- 
Måns Rullgård
mru@inprovide.com


  parent reply	other threads:[~2005-06-14 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-14  8:54 Nico Schottelius
2005-06-14 10:54 ` Bart Hartgers
2005-06-14 11:03   ` Nico Schottelius
2005-06-14 11:32   ` Måns Rullgård [this message]
2005-06-14 12:19     ` Richard B. Johnson
2005-06-14 16:07 Chad Kitching

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw1xvf4h6uni.fsf@ford.inprovide.com \
    --to=mru@inprovide.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®