Re: postmaster.pid

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Brown <kevin(at)sysexperts(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: postmaster.pid
Date: 2003-01-21 18:49:51
Message-ID: 3E2D964F.2030103@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I validate my pid by examining /proc/pid , something as simple as

if [ -d `cat postmaster.pid` ]
then
echo postmaster is running
else
echo postmaster is not running
fi

Tom Lane wrote:

>Kevin Brown <kevin(at)sysexperts(dot)com> writes:
>
>
>>Tom Lane wrote:
>>
>>
>>>Yeah, if you search the archives you will find previous discussions of
>>>how the check for a pre-existing postmaster could be made more resistant
>>>to false matches. It seems to be a hard problem to solve in a way
>>>that's both portable and 100% safe (while false positives are annoying,
>>>false negatives are completely not acceptable). AFAIR all the
>>>alternative methods that we've heard about have their own downsides.
>>>
>>>
>
>
>
>>I assume one of those alternatives was for the postmaster to open and
>>lock a predefined file in $PGDATA (say, postmaster.lock) using fcntl
>>or flock style locking?
>>
>>
>
>Yes, that was discussed. I think the primary objection was that it's
>very non-robust if the $PGDATA directory is mounted via NFS. (Quite
>a few of us think that if you run a database over NFS, you deserve to
>lose ;-( ... but there seem to be more than a few people out there doing
>it anyway.)
>
>Also, the fact that you even had to mention two different ways of doing
>it is prima facie evidence that there are portability issues...
>
> regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message samira 2003-01-21 19:51:11 plpgsql question
Previous Message Tom Lane 2003-01-21 18:48:50 Re: PL/Python