postgres under linux can't start because of postmaster.pid - Mailing list pgsql-hackers

From Richard Wang
Subject postgres under linux can't start because of postmaster.pid
Date
Msg-id ffmt8d$1tem$1@news.hub.org
Whole thread Raw
Responses Re: postgres under linux can't start because of postmaster.pid
List pgsql-hackers
I construct a postmaster.pid file and then set the pid to be one of existing 
process id(not postgres, e.g vim), then I run postgres. This may happen if 
postgres crashed last time and left a postmaster.pid file, and last postgres 
id is reused by another process which is not postgres now.

What I expect is that postgres runs normally and overwrites postmaster.pid 
with new postgres id.

In windows it succeeds, but in linux it reports error as follows:
FATAL:  lock file "postmaster.pid" already exists
HINT:  Is another postmaster (PID 9899) running in data directory 
"/home/hcwang/threading/bin/data"?

the pid file content is as follows:
9899
/home/hcwang/postgres/bin/data 5432001         0

and I run 'ps -u hcwang'
9899 pts/8    00:00:00 vim

Is this a bug or? Why pg under windows and linux have different behavior?





pgsql-hackers by date:

Previous
From: "Matthew Alton"
Date:
Subject: Built PostgreSQL 8.3 BETA on FreeBSD/SPARC64
Next
From: "Dharmendra Goyal"
Date:
Subject: second DML operation fails with updatable cursor