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

Oliver Elphick wrote:

>On Wed, 2002-11-20 at 10:14, Luis Sousa wrote:
>  
>
>>Hi all,
>>
>>I'm running postgresql 7.2.1 on a debian 3.0 machine and I want to do 
>>some log rotation, but I'm having some problems. The configuration that 
>>I'm using is:
>>In /etc/logrotate.d/postgres:
>>/var/log/postgres.log {
>>        weekly
>>        rotate 52
>>        compress
>>        delaycompress
>>        notifempty
>>        create 640 postgres postgres
>>        sharedscripts
>>        postrotate
>>                /etc/init.d/postgresql restart > /dev/null
>>        endscript
>>}
>>
>>But when this is executed, always is returned the following error:
>>
>>pg_ctl: Another postmaster may be running.  Trying to start postmaster anyway.
>>pg_ctl: cannot start postmaster
>>Examine the log output.
>>
>>Any sugestions !! What's wrong ?
>>    
>>
>
>You don't want to restart the postmaster; suppose someone has a
>long-running query in progress at that moment.  As to what is going
>wrong, what does the log output say?
>
>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 ?

Thanks in advance
Luis Sousa


-- 
Luis Sousa
Especialista de Inform?tica
Gabinete de Gest?o de Informa??o, ext: 7837
Campus de Gambelas
Universidade do Algarve, tel: 289800900

Attachments:

  smime.p7s (application/x-pkcs7-signature, 3.2K) download

view thread (4+ messages)  latest in thread

Message-ID: <3DE5EBC0.60808@ualg.pt>
Permalink:  ../3DE5EBC0.60808@ualg.pt/
Also on:    postgresql.org/message-id/3DE5EBC0.60808@ualg.pt

 · 

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: llsousa@ualg.pt, olly@lfix.co.uk
  Subject: Re: Logrotate
  In-Reply-To: <3DE5EBC0.60808@ualg.pt>
  References: <3DDB6072.1010301@ualg.pt> <1037794093.29670.97.camel@linda> <3DE5EBC0.60808@ualg.pt>

* 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