From 824e0e4686dd0711686aecebd70119d660e14680 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 24 Aug 2009 20:08:40 +0000 Subject: Try to make silent_mode behave somewhat reasonably. Instead of sending stdout/stderr to /dev/null after forking away from the terminal, send them to postmaster.log within the data directory. Since this opens the door to indefinite logfile bloat, recommend even more strongly that log output be redirected when using silent_mode. Move the postmaster's initial calls of load_hba() and load_ident() down to after we have started the log collector, if we are going to. This is so that errors reported by them will appear in the "usual" place. Reclassify silent_mode as a LOGGING_WHERE, not LOGGING_WHEN, parameter, since it's got absolutely nothing to do with the latter category. In passing, fix some obsolete references to -S ... this option hasn't had that switch letter for a long time. Back-patch to 8.4, since as of 8.4 load_hba() and load_ident() are more picky (and thus more likely to fail) than they used to be. This entire change was driven by a complaint about those errors disappearing into the bit bucket. --- doc/src/sgml/config.sgml | 54 ++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index dbdd0a0dbc4..0864465f32a 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -2572,7 +2572,37 @@ local0.* /var/log/postgresql - + + + silent_mode (boolean) + + silent_mode configuration parameter + + + + Runs the server silently. If this parameter is set, the server + will automatically run in background and disassociate from the + controlling terminal. + This parameter can only be set at server start. + + + + + When this parameter is set, + the server's standard output and standard error are redirected + to the file postmaster.log within the data directory. + There is no provision for rotating this file, so it will grow + indefinitely unless server log output is redirected elsewhere + by other settings. It is recommended that log_destination + be set to syslog or that logging_collector be + enabled when using this option. Even with those measures, errors + reported early during startup may appear in + postmaster.log rather than the normal log destination. + + + + + @@ -2706,26 +2736,6 @@ local0.* /var/log/postgresql - - silent_mode (boolean) - - silent_mode configuration parameter - - - - Runs the server silently. If this parameter is set, the server - will automatically run in background and any controlling - terminals are disassociated. - The server's standard output and standard error are redirected - to /dev/null, so any messages sent to them will be lost. - Unless syslog logging is selected or - logging_collector is enabled, using this parameter - is discouraged because it makes it impossible to see error messages. - This parameter can only be set at server start. - - - - -- cgit v1.2.3