Re: [HACKERS] postmaster crash and .s.pgsql file

From: James Hughes <jamesh(at)interpath(dot)com>
To: The Hermit Hacker <scrappy(at)hub(dot)org>
Cc: Goran Thyni <goran(at)bildbasen(dot)se>, maillist(at)candle(dot)pha(dot)pa(dot)us, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] postmaster crash and .s.pgsql file
Date: 1998-01-28 13:24:40
Message-ID: Pine.LNX.3.93.980128070554.7147B-100000@xport.bluewall.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 27 Jan 1998, The Hermit Hacker wrote:

: On Tue, 27 Jan 1998, James Hughes wrote:
:
: > On 27 Jan 1998, Goran Thyni wrote:
: >
: > :
: > : On Mon, 26 Jan 1998, Bruce Momjian wrote:
: > :
: > : :
: > : : When the postmaster crashes, it leaves the /tmp/.s.pgsql file in /tmp.
: > : : Is there a way to auto-remove it after a postmaster crash?
: > : :
: >
: > <snip>
: >
: > : I will look at removing the file on startup when I'm in there.
: > :
: > : Don't, it gets removed at shutdown except when crashing.
: > : Removing at startup opens a whole new can of worms.
: > : (You must no postmaster is not already running.)
: > :
: >
: > How about in postmaster.c (arround line 427), when starting up...
: >
: > 1.) Check for the existence of a pid file.
: >
: > 2.) If one is there, read the pid and see if a back end is alive.
: >
: > 3.) If so, warn the user and exit.
: >
: > 4.) If not, check for and cleanup any leftover files.
: >
: > 5.) Continue with startup process.
: >
: > ...wouldn't this work OK?
:
: A thought. Why not change the startup routine such that instead
: of creating /tmp/.s.PGSQL.5432, create a subdirectory that contains both
: the socket (.socket) and the PID file? Given time, I could see us adding
: in some stats to the postmaster process, similar to named, where you
: SIGUSR2 the process and it dumps a status file and that too could get
: dumped there.
:
: Just a thought...
:

I would opt for /var/run to store the pid files and have the name set to
pgsql.$PORT. A ".pgsql" subdirectory in /tmp would be nice to store all
the sockets. You mentioned syslog capability in a previous message
and maybe an rc file is needed too...

I'm with Goran though, we should save these for one of the next
(6.3.[1-3]) releases.

-James

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Darren King 1998-01-28 14:02:34 Re: [HACKERS] No: implied sort with group by
Previous Message The Hermit Hacker 1998-01-28 12:35:09 Re: [HACKERS] Domain Problem?