Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 40AA5475FC8 for ; Thu, 30 Jan 2003 12:10:38 -0500 (EST) Received: from polaris.pinpointresearch.com (66-7-238-176.cust.telepacific.net [66.7.238.176]) by postgresql.org (Postfix) with ESMTP id 8F938475F31 for ; Thu, 30 Jan 2003 12:10:37 -0500 (EST) Received: from there (66-7-238-179.cust.telepacific.net [66.7.238.179]) by polaris.pinpointresearch.com (Postfix) with SMTP id ADD63103EF; Thu, 30 Jan 2003 09:10:42 -0800 (PST) Content-Type: text/plain; charset="iso-8859-1" From: Steve Crawford Organization: Pinpoint Research To: Oliver Elphick , "Rajesh Kumar Mallah." Subject: Re: Postgres server output log Date: Thu, 30 Jan 2003 09:10:42 -0800 X-Mailer: KMail [version 1.3.1] Cc: Mintoo Lall , pgsql-admin@postgresql.org References: <20030130045105.28846.qmail@web14806.mail.yahoo.com> <200301301052.36984.mallah@trade-india.com> <1043930409.1112.203.camel@linda.lfix.co.uk> In-Reply-To: <1043930409.1112.203.camel@linda.lfix.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20030130171042.ADD63103EF@polaris.pinpointresearch.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/339 X-Sequence-Number: 7181 This is OK. The script isn't HUPping PostgreSQL, it is HUPping syslog. I think configuring PostgreSQL to write to syslog is the correct way to go. Once you decide to route the messages to syslogy you get everything that syslog offers such as: directing output to files, pipes or central log servers (in any combination) selectively dropping or writing messages based on severity many ready-made management tools like logrotate many ready-made monitoring tools like swatch and logwatch You can even choose alternate versions of the syslog daemon - I have one server runing msyslogd (Modular Syslog Daemon) with the PostgreSQL module installed so I can write syslog entries for a project directly into a PostgreSQL database for retrieval or analysis. So my advice is to complie/configure PostgreSQL to use syslog and use the myriad of available syslog tools for management and analysis. Cheers, Steve On Thursday 30 January 2003 4:40 am, Oliver Elphick wrote: > On Thu, 2003-01-30 at 05:22, Rajesh Kumar Mallah. wrote: > > This is someones' elses' posting that i have preserved > > shud be useful. > > ... > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` > > > > Well, > > the most correct way to do a logrotate is ( Redhat ): > > ... > > > 2) Put on the directory /etc/logrotate.d a file called > > 'postgres' with the following lines: > > > > /var/log/postgresql.log { > > compress > > rotate 2 > > size=10000k > > errors mendola@bigfoot.com > > create 0664 postgres postgres > > daily > > postrotate > > /usr/bin/killall -HUP syslogd > > endscript > > } > > ... > > This won't work as it stands with PostgreSQL, because the hangup signal > does not make the postmaster reopen the log file. Instead of that > postrotate section, you need to use logrotate's copytruncate option, > which will copy the logfile to another file before zeroing the logfile. > > Depending on what is being logged, you may want to change the > permissions to 660; there may be stuff in the logs that you don't want > to reveal to the world. (With copytruncate, I think the create option > applies to the copy files rather than to the original logfile.)