Re: rotatelog / logrotate with PostgreSQL - Mailing list pgsql-general

From Roland Roberts
Subject Re: rotatelog / logrotate with PostgreSQL
Date
Msg-id m2ofanv4hx.fsf@kuiper.rlent.pnet
Whole thread Raw
In response to Re: rotatelog / logrotate with PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: rotatelog / logrotate with PostgreSQL
Re: rotatelog / logrotate with PostgreSQL
List pgsql-general
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

    Tom> "Johnson, Shaunn" <SJohnson6@bcbsm.com> writes:
    >> Can someone send an example of how they have the
    >> logrotate / rotatelog script working with PostgreSQL?

    Tom> Should work to just pipe the postmaster's stderr into it, eg

    Tom>     postmaster ... 2>&1 | logrotate ...  &

Huh?  logrotate moves a log file, it doesn't log anything.

Does the postmaster close the log after writing?  logrotate can move
the log and create a new (empty) one, but if the postmaster has the
log open, it will continue to write to the old one, defeating the
purpose of rotating the log.  Also, if logrotate is configured to
compress the log after rotating, an open connection will result in the
tail of the file being "corrupted" since uncompressed data will be
appended.

So I'm curious too as to how it works; I haven't tried anything at
this point....

roland
--
               PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@rlenter.com                     76-15 113th Street, Apt 3B
roland@astrofoto.org                       Forest Hills, NY 11375

pgsql-general by date:

Previous
From: Tourtounis Sotiris
Date:
Subject: Re: Number of disk pages obtained by explain analyze (fwd)
Next
From: Roland Roberts
Date:
Subject: Re: OID order = INSERT order?