And what about that Debugfile? 
Author Message
 And what about that Debugfile?

There is a "postgres" option -o which can redirect the server output to a
file.  The postmaster output will still go to stderr.  Does anyone recall
how this was supposed to be useful?

Interesting code (from elog):

    /* NOTE: debug file is typically pointed at stderr */
    write(Debugfile, msg_buf, len);

    ...

    /*
     * fflush here is just to improve the odds that we get to see
     * the error message, in case things are so hosed that
     * proc_exit crashes. [...]
     */
    fflush(stdout);
    fflush(stderr);

Fat chance.  ;-)

--

---------------------------(end of broadcast)---------------------------



Mon, 24 Nov 2003 03:51:16 GMT
 And what about that Debugfile?

Quote:

> There is a "postgres" option -o which can redirect the server output to a
> file.  The postmaster output will still go to stderr.  Does anyone recall
> how this was supposed to be useful?

That code is, um, ancient.  I recall having seen comments to the effect
that you were expected to do something like "-o /dev/ttyNN" to redirect
the debug output of a particular backend to your console.  There's even
a field in the initial connection message to allow this to be specified
conveniently --- but I believe we've disabled it for security reasons,
since one doesn't really want random clients to be able to command the
backend to write on an arbitrary filename.

I can see some value in being able to separate the log output of one
backend from the rest of 'em ... but given the security issues, it seems
unlikely that anyone will ever again use the feature in the way it was
intended.  It needs to be rethunk.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Mon, 24 Nov 2003 05:28:55 GMT
 
 [ 2 post ] 

 Relevant Pages 

 
Powered by phpBB® Forum Software