Bug 71295

Summary: PID file isn't removed after system crash, resulting in not starting service
Product: [Retired] Red Hat Linux Reporter: Peter Bieringer <pb>
Component: postgresqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: hhorak, notting
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-05 19:29:42 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 Peter Bieringer 2002-08-12 07:14:27 UTC
Description of problem:
After system crashes, the postgresql service won't start, because of the PID
file /var/lib/pgsql/data/postmaster.pid still exists after rebooting.
Unfortunately, the PID was already valid again after reboot (process httpd..). 
BTW: It's not good to pipe all the postmaster start output to /dev/null,
including the error log. Better will be to put this messages to boot.log.

Version-Release number of selected component (if applicable):
7.2.1-5

How reproducible:
Didn't try

Steps to Reproduce:
1. Hard system reset
2. PID in postgresql PID file was owned after reboot by another process
3. Try to start postgresql
	

Actual Results:  Service won't start

Expected Results:  Initscript detects stale PID file or it will be deleted on
booting.

Additional info:

Comment 1 Trond Eivind Glomsrxd 2002-08-12 18:37:09 UTC
Any possibility of removing pid files in the initscripts, Bill?

Comment 2 Bill Nottingham 2002-08-12 20:43:12 UTC
We remove ones in standard directories (i.e., /var/run). Anything in
non-standard directories probably needs to be handled by the app's init script.

Comment 3 Trond Eivind Glomsrxd 2002-08-12 22:11:10 UTC
The pid file in question is /var/run/postmaster.pid, so it should work then...
recent addition?

Comment 4 Bill Nottingham 2002-08-12 22:56:45 UTC
The pid file referenced in the bug is /var/lib/pgsql/data/postmaster.pid

Comment 5 Trond Eivind Glomsrxd 2002-08-12 23:28:26 UTC
Doh. Yes, there are two. One by the initscript, one for the database. I'll just
forceably remove the latter.

Comment 6 Andrew Overholt 2003-03-12 22:39:46 UTC
This is being addressed in some reworking of the init script.  Reassigning.

Comment 7 Tom Lane 2004-10-05 19:29:42 UTC
I've finally found a hack that solves this problem without the risks
involved in forcibly deleting the lock file.  It's fixed for FC3 and
RHEL3 U4.  See bug #134090.