Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Killing process group run with IPC::Open3

by ikegami (Pope)
on Feb 03, 2012 at 07:22 UTC ( #951615=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Killing process group run with IPC::Open3
in thread Killing process group run with IPC::Open3

So I ran a few tests. It seems that the child can't read from the parent's STDIN. I presume this is the problem to which you are referring.

man 2 setpgrp explains

At any time, one (and only one) of the process groups in the session can be the foreground process group for the terminal; the remaining process groups are in the background.

I don't know what a session is, but adding setsid() appears to solve the problem.


Comment on Re^3: Killing process group run with IPC::Open3
Select or Download Code
Re^4: Killing process group run with IPC::Open3
by pm_sanchay (Initiate) on Feb 03, 2012 at 07:49 UTC

    My bad for using pre. I will be more careful from now.

    Yes, I meant "child can't read from the parent's STDIN".

    setsid()

    does appear to work. But it has another issue - I don't understand what happens if a KILL signal is sent to parent (example cntl-c)? Will have to understand what setsid does.

    Thanks for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-11-27 21:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (188 votes), past polls