pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Luis Sousa <llsousa@ualg.pt>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Logrotate
Date: 28 Nov 2002 10:38:36 +0000
Message-ID: <1038479916.13294.328.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <3DE5EBC0.60808@ualg.pt>
References: <3DDB6072.1010301@ualg.pt>
	<1037794093.29670.97.camel@linda>
	<3DE5EBC0.60808@ualg.pt>

On Thu, 2002-11-28 at 10:11, Luis Sousa wrote:
> >You should use copytruncate as a logrotate option, so that you will not
> >need to force the postmaster to close.
> >
> >This is my (working) setup:
> >
> >    $ cat /etc/logrotate.d/postgresql
> >    /var/log/postgres.log {
> >    	daily
> >    	rotate 10
> >    	copytruncate
> >    	delaycompress
> >    	compress
> >    	notifempty
> >    	create 640 postgres postgres
> >    }
> >
> >  
> >
> Oliver,
> 
> I'm using the definition that you refer but now I have a problem.
> Now, after one rotate, postgres created an empty file, postgres.log, but 
> is witing log on postgres.log.1.
> Why's that ? Why didn't postgre started writing log in postgres.log, the 
> new file that was created ?

The above is my setup and it works, so I don't know why yours wouldn't. 
Is there a bug in logrotate?  What version are you running?  Mine is
3.6.5; copytruncate was added at 2.6, but there is no mention of any
problem with it in the subsequent changelog.


The fact that postgres is writing to postgres.log.1 shows that
copytruncate hasn't worked and a new log has been created, whereas the
old log should have been copied to postgres.log.1 and then truncated in
place.

Try removing the create option (which in fact shouldn't be needed at all
with copytruncate.)

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "The earth is the LORD'S, and the fullness thereof; the
      world, and they that dwell therein."       Psalms 24:1

Attachments:

  signature.asc (application/pgp-signature, 188B) download

view thread (4+ messages)

Message-ID: <1038479916.13294.328.camel@linda.lfix.co.uk>
Permalink:  ../1038479916.13294.328.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1038479916.13294.328.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: olly@lfix.co.uk, llsousa@ualg.pt
  Subject: Re: Logrotate
  In-Reply-To: <1038479916.13294.328.camel@linda.lfix.co.uk>
  References: <3DDB6072.1010301@ualg.pt> <1037794093.29670.97.camel@linda> <3DE5EBC0.60808@ualg.pt> <1038479916.13294.328.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox