Re: subprocesses lifecycle
- From: "C.DeRykus" <ced@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Aug 2008 15:01:08 -0700 (PDT)
On Aug 29, 12:53 pm, "Peter J. Holzer" <hjp-usen...@xxxxxx> wrote:
On 2008-08-29 12:19, C.DeRykus <c...@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Aug 28, 10:43 am, Hans Mulder <han...@xxxxxxxxx> wrote:
What you'd really want, is a way to tell C<open> that you don't want
C<close> to wait for this child. As far as I know, there is currently
no simple way to achieve that.
Wouldn't backgrounding the task
accomplish that:
open my $fd, "/some/task & |"
or die...
Man, that's ugly!
But yes, I think that should work (although I haven't actually tried
it).
I'm not sure why a lone "&" tips the ugly balance :)
However, child subprocesses would then need to be foregrounded with
SIGCONT if the parent wants to kill them before exiting.
No. SIGCONT doesn't "foreground" a process running in the background.
It continues a process which has been stopped. A running process can be
sent signals whether it is in the foreground or the background.
Yes, I mis-spoke but a SIGCONT actually is sent to the process
group when a backgrounded job is
moved to the foreground via "fg"
to enable a terminal read for example. At least that's I glean from
Stevens. Tricky stuff though...
I was also wrong about needing
to foreground the bg jobs so
they could be killed. They can
be killed easily if you know the
pid's. But, there doesn't appear an elegant way to pick them up
without some grubbing around.
--
Charles DeRykus
.
- Follow-Ups:
- Re: subprocesses lifecycle
- From: Peter J. Holzer
- Re: subprocesses lifecycle
- References:
- subprocesses lifecycle
- From: Matthieu Imbert
- Re: subprocesses lifecycle
- From: Eric Pozharski
- Re: subprocesses lifecycle
- From: Matthieu Imbert
- Re: subprocesses lifecycle
- From: Hans Mulder
- Re: subprocesses lifecycle
- From: C.DeRykus
- subprocesses lifecycle
- Prev by Date: Re: subprocesses lifecycle
- Next by Date: FAQ 8.18 How can I do an atexit() or setjmp()/longjmp()? (Exception handling)
- Previous by thread: Re: subprocesses lifecycle
- Next by thread: Re: subprocesses lifecycle
- Index(es):
Relevant Pages
|