Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: CGI fork() inherits

by andal (Friar)
on Feb 14, 2012 at 09:20 UTC ( #953662=note: print w/ replies, xml ) Need Help??


in reply to CGI fork() inherits

Effectively, fork inherits everything from it's parent, even memory. But it gets "copy" of everything. If the child performs "exec", then new process inherits only file descriptors that have FD_CLOEXEC flag cleared. Usually, this is used by the Web server that starts CGI scripts. The server establishes stdout and stdin of the forked child to use created by the Web server pipes and then does "exec" that will run CGI script.

Looks like, your Web server waits till the CGI script closes both STDOUT and STDERR. Which means, that actually all of the data sent to STDERR goes first to Web server and then Web server forwards it to appropriate log file. Most likely, your script does not have enough privileges to open that file. The simplest solution is for your forked child to use different file.


Comment on Re: CGI fork() inherits

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-07-31 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (254 votes), past polls