in reply to IPC::Run not seeing exit of short child run with long timeout
Just change your code so that some pipe between parent and child is closed when your child exits. Then IPC::Run will notice your child's exit. Example:$ strace -p1625 Process 1625 attached - interrupt to quit select(0, NULL, NULL, NULL, {19943, 944000}
Update: Another solution is to simply install a CHLD signal handler. It doesn't have to do anything -- the mere fact that the signal is not ignored will cause the select call to be interrupted:use IPC::Run qw(run timeout timer); my $t = timeout(20000); my $out; run(debug => 1, ["/bin/sleep", 5], '>', \$out, $t);
$SIG{CHLD} = sub {}; run(["/bin/sleep", 5], timeout(20000));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IPC::Run not seeing exit of short child run with long timeout
by wildSmurf (Initiate) on Mar 15, 2008 at 01:09 UTC |