Bug 159503 - initscript hides FATAL messages from postmaster
Summary: initscript hides FATAL messages from postmaster
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: postgresql
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tom Lane
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-03 08:09 UTC by Anchor Systems Managed Hosting
Modified: 2013-07-03 03:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-30 19:45:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Anchor Systems Managed Hosting 2005-06-03 08:09:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050524 Firefox/1.0 (Ubuntu package 1.0.2 MFSA2005-44)

Description of problem:
Migrating a database from a RHEL3 server to RHEL4; the previous postgresql.conf file had the options:

max_fsm_relations = 10000
max_fsm_pages = 100000

I copied this configuration to the new server and restarted postgres, which failed.  The only message was [FAILED] at the end of the line.  No other messages appeared on the console, no errors were logged to /var/log/pgsql, no errors were logged to /var/log/messages, except for this one:

Jun  3 17:53:05 keel postgresql: Starting postgresql service:  failed

I ran "sh -x /etc/init.d/postgresql start", which gave no further information, but then tried the command that was being executed:

runuser -l postgres -c '/usr/bin/postmaster -p 5432 -D '\''/var/lib/pgsql/data'\''  &'

which finally reported:

FATAL:  max_fsm_pages must exceed max_fsm_relations * 16

which, despite being weirdly incorrect, at least explains why postgresql isn't starting.

Version-Release number of selected component (if applicable):
postgresql-server-7.4.8-1.RHEL4.1

How reproducible:
Always

Steps to Reproduce:
1.  Cause a configuration error in data/postgresql.conf
2.  Restart postgresql service.

  

Actual Results:  Observed no error messages explaining the cause of the service failure.

Expected Results:  FATAL errors should get logged to syslog and console, all other errors should at least make it to syslog.

Additional info:

Comment 1 Anchor Systems Managed Hosting 2005-06-03 08:53:24 UTC
(In reply to comment #0)

> max_fsm_relations = 10000
> max_fsm_pages = 100000

> FATAL:  max_fsm_pages must exceed max_fsm_relations * 16
> 
> which, despite being weirdly incorrect, at least explains why postgresql isn't
starting.

(ok, not weird at all, but the actual error is irrelevant here; only that it was
masked by the initscript)


Comment 2 Tom Lane 2005-06-03 14:57:21 UTC
Yeah, this is sort of a catch-22 situation.  You can't really expect config-file
errors to get reported to syslog, since it's only after reading the config file
that the postmaster can know how to send stuff to syslog properly.  The error is
in fact reported to postmaster's stderr, and the problem is that the default
setup in the initscript is to send stderr to /dev/null.  Unfortunately we cannot
readily change that default either, because due to the lack of any log-rotation
capability in Postgres 7.*, any file we did send it to would grow without bound.

This is fixed in Postgres 8.0, and our packaging of 8.0 does do something more
intelligent with the default logging setup, but with 7.* there are no good
alternatives.

See also bug #103767

Comment 3 Anchor Systems Managed Hosting 2005-06-06 00:33:50 UTC
(In reply to comment #2)

> The error is
> in fact reported to postmaster's stderr, and the problem is that the default
> setup in the initscript is to send stderr to /dev/null.  Unfortunately we cannot
> readily change that default either, because due to the lack of any log-rotation
> capability in Postgres 7.*, any file we did send it to would grow without bound.

Well, what about leaving it going to stderr, so that the operator running the
initscript can see the FATAL messages, instead of redirecting it to /dev/null or
a file?

As long as the FATALs aren't masked, it doesn't matter where they go -- I don't
want to jump through hoops to find out an error that postgres is trying to tell me.



Comment 4 Tom Lane 2005-09-30 19:45:20 UTC
I don't think that that would be a very workable solution; initscripts are
normally not run interactively, and so having them write stuff to stderr is
frowned upon.  Ultimately, there just isn't any good solution for this in PG
7.*; which is why the upstream developers did a substantial amount of work to
fix it in 8.0.

There are also policy issues.  With the goal of minimizing risk of change for
deployed systems, and in response to customer and partner requirements, Red Hat
takes a conservative approach when evaluating changes for inclusion in
maintenance updates for currently deployed products. The primary objectives of
update releases are to enable new hardware platform support and to resolve
critical defects.  I don't think I could get approval for putting a short-term
hack for this problem into RHEL4.


Note You need to log in before you can comment on or make changes to this bug.