LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-26-2009, 02:16 AM   #1
bharadiaam
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
File descriptors shared between child and parent causing parent to hang.


Hi There,
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.
 
Old 03-02-2009, 02:01 AM   #2
bharadiaam
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Original Poster
Rep: Reputation: 0
What would happen if I close STDOUT and STDERR before launching the execA executable?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is the parent and child process in given command? brownaryan Linux - Newbie 1 06-30-2008 07:17 PM
parent and child processes skora Programming 5 11-02-2003 11:41 AM
about parent and child process winwar Solaris / OpenSolaris 3 07-23-2003 07:07 AM
child and parent process error jdevanand Programming 1 04-29-2002 09:13 AM
child-parent-&-fork mukul Programming 2 03-24-2001 02:12 PM


All times are GMT -5. The time now is 09:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration