Re: subprocesses lifecycle



Eric Pozharski <whynot@xxxxxxxxxxxxxx> wrote:
Matthieu Imbert <breafk@xxxxxxxxxxxxxxxxxxxxx> wrote:
*SKIP*
Currently, when I detect the timeout, I call die "error message". the
message is displayed, but the script does not return until
subprocesses finish (this may take several minutes, depending on what
the subprocesses do).
*SKIP*
However you say that you have a problem. I suppose you have to
investigate why your script attempts to collect zombies. It should
not unless told so.

I've thought (and read) a lot about this. I believe now, that my guess
is wrong.

There's no problem with zombies (and respectively waiting for childs).
As C.DeRykus clearly showed double fork doesn't help.

Now, I think, that B<perl> waits till pipe closes. That happens when
writer (I intentionally say 'writer' but 'child', because it can be
child of B<init> (since double fork)) intentionally closes pipe or just
terminates.

I was wrong. Again. Sorry for inconvinience.

And what surprises me most is that, as Hans Mulder discovered, lexical
filehandles are waited, globals are not. Wouldn't someone willing to dig
through source and explain why that's that way? I've checked, both of
them are B<isa> B<FileHandle>. And till they differ a lot. Errmm,..
Can I guess again?

*CUT*

--
Torvalds' goal for Linux is very simple: World Domination
.



Relevant Pages

  • Re: subprocesses lifecycle
    ... I have a perl script that forks several subprocesses at various times. ... and have a timeout on all these subprocesses. ... Each successful pipe open will return the child process id. ...
    (comp.lang.perl.misc)
  • Re: trying to understand fork and wait
    ... old habits based on learning to script in REXX on the ... > the child reads it. ... situation for me (drop through to bottom/go back to top of loop). ... just to keep a hold of the exit code. ...
    (comp.lang.perl.misc)
  • Re: Questions about perl daemons with child processes and open files / signals
    ... running as daemon which launch a child process. ... I need to run a perl script as a daemon. ... tcpdump output, but I decided to use a pipe ... the parent process. ...
    (comp.lang.perl.misc)
  • Heirarchical path to the net
    ... traced the path of a net from child or leaf cell to the parent. ... script was run and it used .sch files(we use Calibre, ... Why the script traced up is because some signals have fan outs. ... hiCreateAppForm( ...
    (comp.cad.cadence)
  • Re: New Security Features, Please Comment
    ... then call setuid/gid and then launch the script ... language. ... The idea is to not allow the child to change its own uid, ...
    (Linux-Kernel)