Bug 76503

Summary: SysV Init Scripts Not Reporting Error(s)
Product: [Retired] Red Hat Linux Reporter: Need Real Name <eric>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: hhorak
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-24 04:34:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2002-10-22 15:37:44 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 
1.0.3705)

Description of problem:
Starting postgres with the following line below eats critical error 
information. We has a stale PID file and the error was not logged anywhere and 
the Starting Postgres: Failed message doesn't really tell you a lot.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -
p /usr/bin/postmaster start  > /dev/null 2>&1" < /dev/null


Version-Release number of selected component (if applicable): At least since 
Redhat 7.2


How reproducible:
Always

Steps to Reproduce:
1. Create a PID File for Postgres
2. Start Postgres and it Fails to start with no further error message
3.
	

Expected Results:  The warning about the PID file and shared mem handle should 
have been displayed and not sent to /dev/null

Additional info:

Proposed fix would be a postgres-console.log in /var/log owned by 
postgres.postgres and change the init script to reflect it as such.

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -
p /usr/bin/postmaster start  > /var/log/postgresql-console.log 2>&1" < /dev/null

Comment 1 Andrew Overholt 2003-03-04 17:36:40 UTC
Assigning to me.

Comment 2 Andrew Overholt 2003-03-12 22:56:25 UTC
Reassigning.

Comment 3 Fernando Nasser 2003-03-15 00:24:37 UTC
Eric, you are absolutely right -- we must save the log somewhere.  

The fix is not that simple because the PostgreSQL backend generates an excess of
messages that would eat up your disk space.  We need log rotation but the
backend does not respond to any signal for that purpose.  We will have to pipe
the output through a program that does that.

We are working on that and in the future you will be able to inspect the log.

The situation with the stale pid file is another bug, already reported (#71295),
as the script should be able to recover from that.  It will be fixed in a future
release.

Comment 4 Tom Lane 2005-01-24 04:34:28 UTC
Done finally in PostgreSQL 8.0.