diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-08 01:10:21 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-08 01:10:21 +0000 |
commit | 02b1a7fd5160d4117973527dc6d4214cd225a97c (patch) | |
tree | 47cc4a70b26f65537003f4ee5404866a45087571 /src/backend/postmaster/postmaster.c | |
parent | 6b9f94022c481fdcde45d491b61eddb414454aea (diff) |
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.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 17 |
1 files changed, 14 insertions, 3 deletions
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 * @@ -688,6 +688,15 @@ PostmasterMain(int argc, char *argv[]) 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 */ if (pgstat_init() < 0) @@ -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); /* |