Re: pg_ctl patch to integrate apache's rotatelogs - Mailing list pgsql-patches
From | Bruce Momjian |
---|---|
Subject | Re: pg_ctl patch to integrate apache's rotatelogs |
Date | |
Msg-id | 200405161936.i4GJaol12457@candle.pha.pa.us Whole thread Raw |
In response to | Re: pg_ctl patch to integrate apache's rotatelogs (Peter Eisentraut <peter_e@gmx.net>) |
Responses |
Re: pg_ctl patch to integrate apache's rotatelogs
|
List | pgsql-patches |
Peter Eisentraut wrote: > Bruce Momjian wrote: > > Tom Lane wrote: > > > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > > > Ouch. How long has that documentation been wrong? We have > > > > pointed folks to that section of the docs tons of times, and no > > > > one mentioned that "logrotate" is really "rotatelogs", and that > > > > it is missing parameters? > > > > > > > > I have applied the following patch to document rotatelogs > > > > properly. > > > > > > I think you just broke it. logrotate and rotatelogs are two > > > different programs, and AFAIK the existing documentation correctly > > > described the one that is easier to use with Postgres. > > > > Oh, why don't I have logrotate. My system has: > > > > rotatelogs - rotate Apache logs without having to kill the > > server > > > > rotatelogs logfile rotationtime [offset] > > > > and it says it is Apache's. I must be wrong but can someone explain > > this? > > logrotate rotates log files and hups the servers according to a > configuration file. rotatelogs reads the log data on stdin and reopens > a new output file once in a while. The first hunk of your patch was > wrong, the rest seemed OK. OK, just to confirm, I backed out the first attached patch, but kept the rest, which is my second attached patch. I am still confused how these errors remained in the documentation for so long. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 Index: maintenance.sgml =================================================================== RCS file: /cvsroot/pgsql-server/doc/src/sgml/maintenance.sgml,v retrieving revision 1.33 retrieving revision 1.34 diff -c -c -r1.33 -r1.34 *** maintenance.sgml 5 Apr 2004 03:02:03 -0000 1.33 --- maintenance.sgml 14 May 2004 20:01:19 -0000 1.34 *************** *** 1,5 **** <!-- ! $PostgreSQL: pgsql-server/doc/src/sgml/maintenance.sgml,v 1.33 2004/04/05 03:02:03 momjian Exp $ --> <chapter id="maintenance"> --- 1,5 ---- <!-- ! $PostgreSQL: pgsql-server/doc/src/sgml/maintenance.sgml,v 1.34 2004/05/14 20:01:19 momjian Exp $ --> <chapter id="maintenance"> *************** *** 461,467 **** you can send a <literal>SIGHUP</literal> signal to the <application>syslog</> daemon whenever you want to force it to start writing a new log file. If you want to automate log ! rotation, the <application>logrotate</application> program can be configured to work with log files from <application>syslog</application>. </para> --- 461,467 ---- you can send a <literal>SIGHUP</literal> signal to the <application>syslog</> daemon whenever you want to force it to start writing a new log file. If you want to automate log ! rotation, the <application>rotatelogs</application> program can be configured to work with log files from <application>syslog</application>. </para> Index: maintenance.sgml =================================================================== RCS file: /cvsroot/pgsql-server/doc/src/sgml/maintenance.sgml,v retrieving revision 1.33 retrieving revision 1.34 diff -c -c -r1.33 -r1.34 *** maintenance.sgml 5 Apr 2004 03:02:03 -0000 1.33 --- maintenance.sgml 14 May 2004 20:01:19 -0000 1.34 *************** *** 484,495 **** pipe command: <programlisting> ! pg_ctl start | logrotate </programlisting> The <productname>PostgreSQL</> distribution doesn't include a suitable log rotation program, but there are many available on the ! Internet. For example, the <application>logrotate</application> tool included in the <productname>Apache</productname> distribution can be used with <productname>PostgreSQL</productname>. </para> --- 484,495 ---- pipe command: <programlisting> ! pg_ctl start | rotatelogs /var/log/pgsql_log 86400 </programlisting> The <productname>PostgreSQL</> distribution doesn't include a suitable log rotation program, but there are many available on the ! Internet. For example, the <application>rotatelogs</application> tool included in the <productname>Apache</productname> distribution can be used with <productname>PostgreSQL</productname>. </para> Index: ref/pg_ctl-ref.sgml =================================================================== RCS file: /cvsroot/pgsql-server/doc/src/sgml/ref/pg_ctl-ref.sgml,v retrieving revision 1.25 retrieving revision 1.26 diff -c -c -r1.25 -r1.26 *** ref/pg_ctl-ref.sgml 29 Nov 2003 19:51:39 -0000 1.25 --- ref/pg_ctl-ref.sgml 14 May 2004 20:01:19 -0000 1.26 *************** *** 1,5 **** <!-- ! $PostgreSQL: pgsql-server/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.25 2003/11/29 19:51:39 pgsql Exp $ PostgreSQL documentation --> --- 1,5 ---- <!-- ! $PostgreSQL: pgsql-server/doc/src/sgml/ref/pg_ctl-ref.sgml,v 1.26 2004/05/14 20:01:19 momjian Exp $ PostgreSQL documentation --> *************** *** 87,99 **** server is started in the background, and standard input is attached to <filename>/dev/null</filename>. The standard output and standard error are either appended to a log file (if the <option>-l</option> ! option is used), or redirected to <application>pg_ctl</application>'s standard output (not standard error). If no log file is chosen, the standard output of <application>pg_ctl</application> should be redirected ! to a file or piped to another process, for example a log rotating program, ! otherwise <command>postmaster</command> will write its output to the controlling ! terminal (from the background) and will not leave the shell's ! process group. </para> <para> --- 87,99 ---- server is started in the background, and standard input is attached to <filename>/dev/null</filename>. The standard output and standard error are either appended to a log file (if the <option>-l</option> ! option is used), or redirected to <application>pg_ctl</application>'s standard output (not standard error). If no log file is chosen, the standard output of <application>pg_ctl</application> should be redirected ! to a file or piped to another process such as a log rotating program ! like <application>rotatelogs</>; otherwise the <command>postmaster</command> ! will write its output to the controlling terminal (from the background) ! and will not leave the shell's process group. </para> <para>
pgsql-patches by date: