pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Reinhard Max <reinhard@m4x.de>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7559: syslogger doesn't close stdout and stderr
Date: Thu, 20 Sep 2012 11:06:22 -0400
Message-ID: <17544.1348153582@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.LNX.2.00.1209201036060.6939@albrecht.home.m4x.de>
References: <E1TEMgj-0005PY-Hy@wrigleys.postgresql.org>
	<29557.1348072752@sss.pgh.pa.us>
	<alpine.LNX.2.00.1209192234040.663@albrecht.home.m4x.de>
	<505AC648.7050400@vmware.com>
	<alpine.LNX.2.00.1209201036060.6939@albrecht.home.m4x.de>

Reinhard Max <reinhard@m4x.de> writes:
> After starting PostgreSQL with pg_init, stdout and stderr of all 
> processes are pipes to the logger (as intended), but the logger itself 
> still has FDs 1 and 2 open as inherited from pg_init. I think 
> requiring the caller of pg_init to redirect them is not practical, 
> because then pg_init itself can't give feedback to the user.

That's a fair point.  (I assume you mean pg_ctl not pg_init?)

> So it has 
> to be done either in pg_init or in the logger when those channels 
> aren't needed anymore. I'd prefer doing it in the logger, because the 
> code for it is already there and so that it also works when starting 
> PostgreSQL without using pg_init.

Well, I would have no objection to changing pg_ctl so that it redirects
the postmaster's stdout/stderr when a -l switch is given (actually,
I thought it did that already...).  I do object to changing the logger's
behavior as you suggest, because that will break use-cases that work
today.  One that I've used personally is adding "fprintf(stderr)" calls
in the logger for debugging the logger itself.

			regards, tom lane




view thread (11+ messages)  latest in thread

Message-ID: <17544.1348153582@sss.pgh.pa.us>
Permalink:  ../17544.1348153582@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17544.1348153582@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, reinhard@m4x.de, hlinnakangas@vmware.com
  Subject: Re: BUG #7559: syslogger doesn't close stdout and stderr
  In-Reply-To: <17544.1348153582@sss.pgh.pa.us>
  References: <E1TEMgj-0005PY-Hy@wrigleys.postgresql.org> <29557.1348072752@sss.pgh.pa.us> <alpine.LNX.2.00.1209192234040.663@albrecht.home.m4x.de> <505AC648.7050400@vmware.com> <alpine.LNX.2.00.1209201036060.6939@albrecht.home.m4x.de> <17544.1348153582@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox