Bug 71295 - PID file isn't removed after system crash, resulting in not starting service
Summary: PID file isn't removed after system crash, resulting in not starting service
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: postgresql
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tom Lane
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-12 07:14 UTC by Peter Bieringer
Modified: 2013-07-03 02:59 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-05 19:29:42 UTC
Embargoed:


Attachments (Terms of Use)

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.


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