Re: Log rotation

Manfred Spraul <manfred@colorfullife.com>

From: Manfred Spraul <manfred@colorfullife.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Fernando Nasser <fnasser@redhat.com>, Lamar Owen <lowen@pari.edu>, pgsql-hackers@postgresql.org
Date: 2004-03-14T21:30:15Z
Lists: pgsql-hackers
Bruce Momjian wrote:

>Which basically shows one fsync, no O_SYNC's, and setting of the flag
>only for klog reads.
>  
>

Which sysklogd do you look at? The version from RedHat 9 contains this 
block:

> /*
>  * Crack a configuration file line
>  */
>
> void cfline(line, f)
>         char *line;
>         register struct filed *f;
> {
>         register char *p;
> [snip]
>         if (*p == '-')
>         {
>                 syncfile = 0;
>                 p++;
>         } else
>                 syncfile = 1;
> [snip]
>                 if (syncfile)
>                         f->f_flags |= SYNC_FILE;

And the the fsync depends on SYNC_FILE. As documented in man syslog.conf:

>        You may prefix each entry with the minus ``-'' sign to omit 
> syncing the
>        file  after every logging.  Note that you might lose 
> information if the
>        system crashes right behind a write attempt.  Nevertheless  
> this  might
>        give you back some performance, especially if you run programs 
> that use
>        logging in a very verbose manner.


It's sysklogd-1.4.1rh, I'm not sure what part of it are Redhat specific.

--
    Manfred