Re: more contrib: log rotator - Mailing list pgsql-hackers

From Christopher Browne
Subject Re: more contrib: log rotator
Date
Msg-id 20030524024259.DE5685E088@cbbrowne.com
Whole thread Raw
In response to Re: more contrib: log rotator  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut writes:
> I think not.  It's a little tricky handling it directly in the child
> processes, but it's been done before.

Certainly has...

In the cfengine2 code base, the relevant file is "rotate.c"; it
essentially attaches the file descriptor to a new file "on the fly," and
does so as a separate process.  The code apparently works on NT, too;
there is a comment that indicates that they use chown() rather than
fchown() because the latter doesn't exist on NT.

In fact, that file is well worth taking a look at for strategies on
this.  It's GPLed code, and so may not be suitable for integration, but
there are doubtless some useful techniques to be seen...
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','cbbrowne.com').
http://cbbrowne.com/info/languages.html
"Microsoft is sort of a mixture between the Borg and the
Ferengi. Combine the Borg marketing with Ferengi networking..."
-- Andre Beck in dcouln


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Plan B for log rotation support: borrow Apache code
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime