Re: subprocesses lifecycle



C.DeRykus <ced@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
*SKIP*

open my $fd, "/some/task & |"
or die...

However, child subprocesses would then need to be foregrounded with
SIGCONT if the parent wants to kill them before exiting.

Backgrounding doesn't work. I meant it doesn't matter.

time perl -wle '
open my $h, q{(sleep 1 ; /bin/echo -en xyz ) & |} or die $!;
print `ps --cols 60 -O ppid t`;
print <$h>;
print `ps --cols 60 -O ppid t`;'
PID PPID S TTY TIME COMMAND
2198 2193 S pts/1 00:00:02 bash
7528 2198 S pts/1 00:00:00 perl -wle ?open my $h, q{(sl
7529 7528 Z pts/1 00:00:00 [sh] <defunct>
7530 1 S pts/1 00:00:00 sh -c (sleep 1 ; /bin/echo -
7531 7530 R pts/1 00:00:00 sh -c (sleep 1 ; /bin/echo -
7532 7528 R pts/1 00:00:00 ps --cols 60 -O ppid t

xyz
PID PPID S TTY TIME COMMAND
2198 2193 S pts/1 00:00:02 bash
7528 2198 S pts/1 00:00:00 perl -wle ?open my $h, q{(sl
7529 7528 Z pts/1 00:00:00 [sh] <defunct>
7534 7528 R pts/1 00:00:00 ps --cols 60 -O ppid t


real 0m1.277s
user 0m0.084s
sys 0m0.080s

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



Relevant Pages

  • Re: subprocesses lifecycle
    ... SIGCONT if the parent wants to kill them before exiting. ... Backgrounding doesn't work. ... I meant it doesn't matter. ... % time perl -wle ' ...
    (comp.lang.perl.misc)
  • Re: Penguins Wish Box
    ... It doesn't matter which. ... my example solution has you entering the orange portal and exiting the blue. ...
    (uk.games.video.misc)
  • Re: How tor eturn exit code from Java to a shell script
    ... but if it is the conventional practice and the ... It is simply a matter of exiting the program that you have written. ... Martin Gerner ...
    (comp.lang.java.programmer)
  • Internet Explorer windows instantly closes down
    ... i am having problem with my IE, when i open several windows of IE, in a ... matter of 3-5 minutes it just instantly exiting all the open browser. ... Prev by Date: ...
    (microsoft.public.windowsxp.perform_maintain)