Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEiKi-0002z9-7W for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 15:06:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TEiKf-0001xa-EZ for pgsql-bugs@postgresql.org; Thu, 20 Sep 2012 15:06:27 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8KF6Mh8017545; Thu, 20 Sep 2012 11:06:22 -0400 (EDT) From: Tom Lane To: Reinhard Max cc: Heikki Linnakangas , pgsql-bugs@postgresql.org Subject: Re: BUG #7559: syslogger doesn't close stdout and stderr In-reply-to: References: <29557.1348072752@sss.pgh.pa.us> <505AC648.7050400@vmware.com> Comments: In-reply-to Reinhard Max message dated "Thu, 20 Sep 2012 11:11:59 +0200" Date: Thu, 20 Sep 2012 11:06:22 -0400 Message-ID: <17544.1348153582@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/229 X-Sequence-Number: 34223 Reinhard Max 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