From 02b1a7fd5160d4117973527dc6d4214cd225a97c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 8 Sep 2001 01:10:21 +0000 Subject: Clean up some confusion about where and how to set whereToSendOutput. We will no longer try to send elog messages to the client before we have initialized backend libpq (oops); however, reporting bogus commandline switches via elog does work now (not irrelevant, because of PGOPTIONS). Fix problem with inappropriate sending of checkpoint-process messages to stderr. --- src/backend/postmaster/postmaster.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/backend/postmaster/postmaster.c') diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 0de3ad6b12b..b1e6bc23b2f 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.240 2001/09/07 16:12:48 wieck Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.241 2001/09/08 01:10:20 tgl Exp $ * * NOTES * @@ -687,6 +687,15 @@ PostmasterMain(int argc, char *argv[]) pqsignal(SIGTTIN, SIG_IGN); /* ignored */ pqsignal(SIGTTOU, SIG_IGN); /* ignored */ + /* + * Reset whereToSendOutput from Debug (its starting state) to None. + * This prevents elog from sending messages to stderr unless the + * syslog/stderr switch permits. We don't do this until the postmaster + * is fully launched, since startup failures may as well be reported + * to stderr. + */ + whereToSendOutput = None; + /* * Initialize and startup the statistics collector process */ @@ -1932,8 +1941,6 @@ DoBackend(Port *port) /* Reset MyProcPid to new backend's pid */ MyProcPid = getpid(); - whereToSendOutput = Remote; /* XXX probably doesn't belong here */ - /* * We arrange for a simple exit(0) if we receive SIGTERM or SIGQUIT * during any client authentication related communication. Otherwise @@ -1955,6 +1962,10 @@ DoBackend(Port *port) ClientAuthentication(MyProcPort); /* might not return, if failure */ + /* + * Done with authentication. Prevent SIGTERM/SIGQUIT again until + * backend startup is complete. + */ PG_SETMASK(&BlockSig); /* -- cgit v1.2.3