Re: postmaster.pid

Поиск
Список
Период
Сортировка
Искать
От
Andrew Dunstan
Тема
Re: postmaster.pid
Дата
Msg-id
412B4B37.9020909@dunslane.net
Ответ на
Список
Дерево обсуждения
Re: postmaster.pid "Dave Page" <dpage@vale-housing.co.uk>
Re: postmaster.pid Andrew Dunstan <andrew@dunslane.net>
Re: postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>
Re: postmaster.pid Andrew Dunstan <andrew@dunslane.net>
Re: postmaster.pid Tom Lane <tgl@sss.pgh.pa.us>


Dave Page wrote:

>  
>
>     ------------------------------------------------------------------------
>     *From:* pgsql-hackers-win32-owner@postgresql.org
>     [mailto:pgsql-hackers-win32-owner@postgresql.org] *On Behalf Of
>     *Dave Page
>     *Sent:* 20 August 2004 20:57
>     *To:* Barry Lind; pgsql-hackers-win32@postgresql.org
>     *Cc:* Max Dunn
>     *Subject:* Re: [pgsql-hackers-win32] postmaster.pid
>
>      
>      
>     I've been thinking about this problem as well, and think you might
>     just be on to something here. I'll look into this some more...
>      
>
> The correct way to do this is MoveFileEx("postmaster.pid", NULL, 
> MOVEFILE_DELAY_UNTIL_REBOOT);. This /should/ write a registry entry to 
> tell the system to delete the file at reboot. Unfortunately, it seems 
> that this is an administrator-only operation which of course means it 
> won't work when run under the postgresql service account.
>  
>

I think we're on the wrong track here. If there is a pid file then the 
postmaster will try to see if the process is running by calling 
kill(pid,0) - see backend/utils/init/miscinit.c.

However, on Windows we simulate kill(), and always return EINVAL if the 
signal <= 0 (see port/kill.c). ISTM the correct solution would be to 
implement the effect of kill(pid,0) in port/kill.c, presumably by a call 
to some native Windows function that gives you the process info for a 
given pid.

cheers

andrew
В списке pgsql-hackers-win32 по дате отправления
От: Magnus Hagander
Дата:
От: G Reina
Дата:
FAQ