Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: CGI fork() inherits

by andal (Hermit)
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://953662]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2018-02-22 09:37 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (289 votes). Check out past polls.