Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D2FDE475A9E for ; Thu, 28 Nov 2002 05:38:39 -0500 (EST) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by postgresql.org (Postfix) with ESMTP id 5701547656E for ; Thu, 28 Nov 2002 05:38:36 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 18HM45-0008J2-0X; Thu, 28 Nov 2002 10:38:37 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18HM44-0007ro-00; Thu, 28 Nov 2002 10:38:36 +0000 Subject: Re: Logrotate From: Oliver Elphick To: Luis Sousa Cc: pgsql-admin In-Reply-To: <3DE5EBC0.60808@ualg.pt> References: <3DDB6072.1010301@ualg.pt> <1037794093.29670.97.camel@linda> <3DE5EBC0.60808@ualg.pt> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-aHmhaVfrHpFFuV88MqOx" Organization: LFIX Limited Message-Id: <1038479916.13294.328.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 28 Nov 2002 10:38:36 +0000 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/293 X-Sequence-Number: 6481 --=-aHmhaVfrHpFFuV88MqOx Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 > > } > > > >=20=20 > > > Oliver, >=20 > 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= =20 > is witing log on postgres.log.1. > Why's that ? Why didn't postgre started writing log in postgres.log, the= =20 > new file that was created ? The above is my setup and it works, so I don't know why yours wouldn't.=20 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.) --=20 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D "The earth is the LORD'S, and the fullness thereof; the world, and they that dwell therein." Psalms 24:1 --=-aHmhaVfrHpFFuV88MqOx Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA95fIsYU1MND4dDBwRApnbAKCOJyaawG5zFeVgNpoFPG4FJqqYwQCgmTXn exi6hRXcMJqfZ8XYM4zR7Q8= =r7JG -----END PGP SIGNATURE----- --=-aHmhaVfrHpFFuV88MqOx--