Nic Ferrier (nferrier@tapsellferrier.co.uk) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
syslog logging setup broken?

Long Description
When building from the latest (7.1 beta 4+) CVS I had a problem with syslog logging.

Every time I started the postmaster the logger would fail with the message:
  logger: FATAL 1:  'syslog' is not a valid option name
I eventually tracked this down to being something to do with the postgresql.conf file's specifiying of the logging.

I fixed the problem by commenting out the command to turn on syslog terminal log output.

This led me to examine the startup file supplied for Linux users in more detail. I believe it's broken.

See the example code below.


BTW in case you need to know my system is a Sun running Debian (2.2).	

Sample Code
My postgresql.conf looks a bit like this:
 # turn on logging of connections
 log_connections = on

 # make all logs go to syslog and terminal
 # (TF run Postgres with no terminal mostly 
 #  but it's usefull when debugging)
 # syslog = 1

When the syslog=1 statement is NOT commented out the server won't start.


The relevant part of the startup file, which I copied from the RedHat example, looks like this:

 if [ ${USE_SYSLOG} = "yes" ]; then
    su - ${PGACCOUNT} -c "(${POSTMASTER} -D ${PGDATA} ${PGOPTS} 2>&1 
        | logger -p ${FACILITY}.notice) &" > /dev/null 2>&1 &
 else
    su - ${PGACCOUNT} -c "${POSTMASTER} -D ${PGDATA} ${PGOPTS} 
        >> ${PGLOGFILE} 2>&1 &" > /dev/null 2>&1 &
 fi


Now surely this will cause either the syslog or a tmp file to recieve output but not both.

Unless there's something inside the postmaster itself that does these logging operations, in which case the startup file doesn't need to pipe to the logger.

No file was uploaded with this report


Sun, 4 Feb 2001 09:31:44 -0500 (EST)
pgsql-bugs@postgresql.org
syslog logging setup broken?
> Nic Ferrier (nferrier@tapsellferrier.co.uk) reports a bug with a severity of 3

> The relevant part of the startup file, which I copied from the RedHat example, looks like this:

The example startup file is outdated and broken.  Don't use it.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Sun, 4 Feb 2001 16:10:14 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: syslog logging setup broken?
Peter Eisentraut <peter_e@gmx.net> writes:
> The example startup file is outdated and broken.  Don't use it.

Er ... shouldn't we fix it?  Or remove it?

			regards, tom lane

Sun, 04 Feb 2001 15:15:34 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: syslog logging setup broken? 
Tom Lane writes:

> Peter Eisentraut <peter_e@gmx.net> writes:
> > The example startup file is outdated and broken.  Don't use it.
>
> Er ... shouldn't we fix it?  Or remove it?

See my message on -hackers, "Sparc/Linux patch" thing follow-up.

The bottom line is that, IMHO, writing a portable init.d style (or any
other such concept) startup file that is ready for blind use is beyond
practicality.  It might be better to collect a few of the ones that are
being used now (Red Hat-style, SuSE-style, Debian, *BSD-style) and ship
them.  This should be coordinated with the packagers, though.

I'll try to look into it.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Sun, 4 Feb 2001 22:57:23 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: syslog logging setup broken? 
> Tom Lane writes:
> 
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > The example startup file is outdated and broken.  Don't use it.
> >
> > Er ... shouldn't we fix it?  Or remove it?
> 
> See my message on -hackers, "Sparc/Linux patch" thing follow-up.
> 
> The bottom line is that, IMHO, writing a portable init.d style (or any
> other such concept) startup file that is ready for blind use is beyond
> practicality.  It might be better to collect a few of the ones that are
> being used now (Red Hat-style, SuSE-style, Debian, *BSD-style) and ship
> them.  This should be coordinated with the packagers, though.
> 

Should I remove init.d from /contrib?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 4 Feb 2001 17:07:40 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Re: syslog logging setup broken?