Re: [HACKERS] pid file for postmaster? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] pid file for postmaster?
Date
Msg-id 13198.943545546@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] pid file for postmaster?  (Tim Holloway <mtsinc@southeast.net>)
List pgsql-hackers
Tim Holloway <mtsinc@southeast.net> writes:
> Red Hat ALREADY creates a file "postmaster.pid" in the /var/lock directory.

If they did it just like that, then they broke the ability to run more
than one postmaster on the same machine.  Also, there is the question
of what the permissions are on /var/lock.  If they're tight then postgres
can't be an ordinary unprivileged user, which is bad.  If they're loose
then anyone can come along and cause trouble by fiddling with the lock
files.

There was considerable discussion of this whole area last year in
pg-hackers (check the thread "flock patch breaks things here" and
related threads starting in late Aug. 1998).  We were focusing mostly
on the use of lockfiles to ensure that one didn't accidentally start
two postmasters in the same database dir and/or with the same port
number; but if the lockfiles contain PIDs then of course they can also
serve as a contact point for a signal-sender.

Tatsuo, if you have forgotten that discussion you may want to go back
and re-read it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [PATCHES] ':' and ';' operators
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Re: [PATCHES] ':' and ';' operators