Re: [HACKERS] postmaster.pid not visible

Lists: pgsql-generalpgsql-hackers
From: cinu <cheriyamoozhiyilcinu(at)yahoo(dot)co(dot)in>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: postmaster.pid not visible
Date: 2008-07-16 06:10:50
Message-ID: 113269.78113.qm@web7907.mail.in.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Hi All,

I installed PostgreSQL-8.3.1 on my Suse Linux machine, it went on fine without any problems and I was able to create and access the database, even I was able to start, restart and check the status of the service.
Since it is my local machine and people are remotly connecting to the database on my local machine, I used to keep the machine up and running.

Today I came and checked and It was telling me that the service of postgres is not running, so I went and checked the postmaster.pid file it was not in the data folder, but I was able to get to the psql prompt and execute standard sql statements, even people were able to connect remotly and access the databse on my machine.

The only difficult that I was facing was that I was unable to restart or stop the service.

So with the help of the ps -ef | grep postgres command I was able to trace out the pid and then manually kill the pid with the kill -9 command, after this I was able to restart, stop or check the status of the service.

Can anyone throw light on why the postmaster.pid was not visible, the other intresting factor that I observed was that the postgres service was running on the 5432 port this was visible from the /tmp location.

Also I would like to know if theer is any other alternative with which i can restart the service and retain the postmaster.pid file.

Thanks in advance
Regards
Cinu

Explore your hobbies and interests. Go to http://in.promos.yahoo.com/groups/


From: Decibel! <decibel(at)decibel(dot)org>
To: cheriyamoozhiyilcinu(at)yahoo(dot)co(dot)in
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] postmaster.pid not visible
Date: 2008-07-17 16:19:36
Message-ID: D9267430-9D8E-4714-9109-7F5FF2A6ED69@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Moving to -general. -hackers is for discussion about PG development.

On Jul 16, 2008, at 1:10 AM, cinu wrote:

> Hi All, I installed PostgreSQL-8.3.1 on my Suse Linux machine

You should upgrade; I'm pretty sure 8.3 is up to 8.3.3 now.

> , it went on fine without any problems and I was able to create and
> access the database, even I was able to start, restart and check
> the status of the service. Since it is my local machine and people
> are remotly connecting to the database on my local machine, I used
> to keep the machine up and running. Today I came and checked and It
> was telling me that the service of postgres is not running, so I
> went and checked the postmaster.pid file it was not in the data
> folder, but I was able to get to the psql prompt and execute
> standard sql statements, even people were able to connect remotly
> and access the databse on my machine. The only difficult that I was
> facing was that I was unable to restart or stop the service. So
> with the help of the ps -ef | grep postgres command I was able to
> trace out the pid and then manually kill the pid with the kill -9
> command, after this I was able to restart, stop or check the status
> of the service.
Don't use kill -9. There's almost never a reason to do that, and
hasn't been for probably 20 years or more.

> Can anyone throw light on why the postmaster.pid was not visible,
> the other intresting factor that I observed was that the postgres
> service was running on the 5432 port this was visible from the /tmp
> location. Also I would like to know if theer is any other
> alternative with which i can restart the service and retain the
> postmaster.pid file.

My guess would be that something went in and removed the .pid file.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Decibel! <decibel(at)decibel(dot)org>
Cc: cheriyamoozhiyilcinu(at)yahoo(dot)co(dot)in, pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] postmaster.pid not visible
Date: 2008-07-17 18:43:15
Message-ID: 27595.1216320195@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

Decibel! <decibel(at)decibel(dot)org> writes:
> Moving to -general. -hackers is for discussion about PG development.
> On Jul 16, 2008, at 1:10 AM, cinu wrote:
>> Can anyone throw light on why the postmaster.pid was not visible,

> My guess would be that something went in and removed the .pid file.

I was wondering if the postmaster was running in some other data
directory than the OP thought. I've never heard of anything just
randomly removing a .pid file from a data directory; and it would
be extremely dangerous if that did happen, since the pidfile is the
main interlock against starting two postmasters in the same directory.

regards, tom lane


From: "Douglas McNaught" <doug(at)mcnaught(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Decibel! <decibel(at)decibel(dot)org>, cheriyamoozhiyilcinu(at)yahoo(dot)co(dot)in, "pgsql-general List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] postmaster.pid not visible
Date: 2008-07-17 19:21:43
Message-ID: 5ded07e00807171221i8f675b2s58aef0be3a09872@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-hackers

On Thu, Jul 17, 2008 at 2:43 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I was wondering if the postmaster was running in some other data
> directory than the OP thought. I've never heard of anything just
> randomly removing a .pid file from a data directory; and it would
> be extremely dangerous if that did happen, since the pidfile is the
> main interlock against starting two postmasters in the same directory.

Maybe somebody's cleanup script was deleting old files in /var/run
(which I agree is a really bad idea).

-Doug