Re: more contrib: log rotator

From: Christopher Browne <cbbrowne(at)cbbrowne(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: more contrib: log rotator
Date: 2003-05-24 02:42:58
Message-ID: 20030524024259.DE5685E088@cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-05-24 04:03:57 Re: [GENERAL] Small patch for PL/Perl Misbehavior with Runtime
Previous Message Bruce Momjian 2003-05-24 01:33:52 Re: Plan B for log rotation support: borrow Apache code