postgres under linux can't start because of postmaster.pid

From: "Richard Wang" <ruc_wang(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: postgres under linux can't start because of postmaster.pid
Date: 2007-10-24 07:46:22
Message-ID: ffmt8d$1tem$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2007-10-24 07:47:53 Re: Feature Freeze date for 8.4
Previous Message ITAGAKI Takahiro 2007-10-24 07:29:19 VACUUM always makes all pages dirty