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

Поиск
Список
Период
Сортировка
От Goran Thyni
Тема Re: [HACKERS] postmaster crash and .s.pgsql file
Дата
Msg-id 19980127142639.5107.qmail@guevara.bildbasen.se
обсуждение исходный текст
Ответ на Re: [HACKERS] postmaster crash and .s.pgsql file  (James Hughes <jamesh@interpath.com>)
Список pgsql-hackers
   : 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?

It would,
but it would be complex.

The easy way to check for a pid is "kill -0 PID".
But...
It only works if we are running under the same user
as the server (or root).

Besides,
 we do not know that a process running as that
pid really is a postmaster w/o checking the process
table - and that is "portability hell".

Besides 2,
how do get the pid in the first place?
If you code it into the socket, like:
/tmp/.s.PORTNR.PID
how would the clients find the socket to connect to?
(they do not know the pid of the server)

Better leave it until after 6.3 (at least).

      best regards,
--
---------------------------------------------
G�ran Thyni, sysadm, JMS Bildbasen, Kiruna


В списке pgsql-hackers по дате отправления:

Предыдущее
От: darrenk@insightdist.com (Darren King)
Дата:
Сообщение: Re: [HACKERS] No: implied sort with group by
Следующее
От: "Vadim B. Mikheev"
Дата:
Сообщение: Re: [HACKERS] Group By bug in snapshot 270198