File descriptors shared between child and parent causing parent to hang.
I fork a child which is a very long process. Parent exits immediately. This all code has been written in C producing an executable. lets call it execA. I cannot change this code.
Now from perl I call this executable. this perl file is invoked through CGI. Currently I am invoking this file using ``(backticks). The parent process exits fro execA. After that the perl program exits as expected. But the CGI call doesn't exit. It waits for child to exit. Now how should I call the execA from perl so that as soon as parent process exits CGI should exit.
As far as I understand the file descriptors for child and parent process are same. Hence STDOUT stream is not closed of parent process according to CGI.
I have tried closing STDOUT and STDERR in perl program but doesnt work.
Correct me if I am wrong anywhere.
Hope I am pretty clear with my problem.
What would happen if I close STDOUT and STDERR before launching the execA executable?
|All times are GMT -5. The time now is 01:35 AM.|