Unix Technical Forum

postmaster.pid file

This is a discussion on postmaster.pid file within the pgsql Admins forums, part of the PostgreSQL category; --> Hi Everybody, I experienced something a bit strange. When I issued, on a linux machine, the following command as ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:05 AM
Tena Sakai
 
Posts: n/a
Default postmaster.pid file

Hi Everybody,

I experienced something a bit strange.
When I issued, on a linux machine, the following
command as user postgres:
~/bin/pg_ctl -D ~/bin reload
It wasn't happy. The complaint was:
pg_ctl: PID file "/usr/local/pgsql/bin/postmaster.pid" does not exist
Is server running?

Upon checking, I discovered that the file postmaster.pid was
in data directory and as I copied it into ~/bin directory (and
changed the ownership and permission appropriately), it sent
the HUP signal to the server process and all was well. I am
sure I have issued this command before and never had problems
like today.

Question 1:
What happened?
Did I do the right thing? If not, please tell me what I
should've and could've done.

Question 2:
As I looked at the pid file, there were three lines. The
first line seemed like the pid of the server process. The
second line indicates where the database cluster resides.
In my case it is /usr/local/pgsql/data. The last line has
two numbers. In my case they are: 5432001 and 131072.
What do they represent? I don't seem to have processes
by such id.

Thank you in advance.

Regards,

Tena Sakai
tsakai@gallo.ucsf.edu


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:05 AM
Tom Lane
 
Posts: n/a
Default Re: postmaster.pid file

"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> When I issued, on a linux machine, the following
> command as user postgres:
> ~/bin/pg_ctl -D ~/bin reload
> It wasn't happy.


As well it shouldn't be. -D is supposed to specify the data directory,
not the place where the executables are.

> Upon checking, I discovered that the file postmaster.pid was
> in data directory and as I copied it into ~/bin directory (and
> changed the ownership and permission appropriately),


That was a bad idea; you'll have to delete it from there manually.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 08:05 AM
Tena Sakai
 
Posts: n/a
Default Re: postmaster.pid file

Thank you, Tom.

As I typed:
~/bin/pg_ctl -D ~/bin reload

I thought I had typed:
~/bin/pg_ctl -D ~/data reload

(Had I not copied-and-pasted the actual command,
I would have given you the correct line, which
would have been really bad!) I was blind!

I got the extra file in ~/bin directory removed.

Regards,

Tena
tsakai@gallo.ucsf.edu

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Mon 8/13/2007 3:37 PM
To: Tena Sakai
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] postmaster.pid file

"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> When I issued, on a linux machine, the following
> command as user postgres:
> ~/bin/pg_ctl -D ~/bin reload
> It wasn't happy.


As well it shouldn't be. -D is supposed to specify the data directory,
not the place where the executables are.

> Upon checking, I discovered that the file postmaster.pid was
> in data directory and as I copied it into ~/bin directory (and
> changed the ownership and permission appropriately),


That was a bad idea; you'll have to delete it from there manually.

regards, tom lane


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 08:05 AM
Tom Lane
 
Posts: n/a
Default Re: postmaster.pid file

"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> As I typed:
> ~/bin/pg_ctl -D ~/bin reload
> I thought I had typed:
> ~/bin/pg_ctl -D ~/data reload


I recommend setting up PGDATA as an environment variable, so you never
have to type it at all ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 08:06 AM
Peter Eisentraut
 
Posts: n/a
Default Re: postmaster.pid file

Tena Sakai wrote:
> ~/bin/pg_ctl -D ~/bin reload


It's quite unlikely that your data directory is "~/bin".

> As I looked at the pid file, there were three lines. The
> first line seemed like the pid of the server process. The
> second line indicates where the database cluster resides.
> In my case it is /usr/local/pgsql/data.


That should be your -D argument then.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 08:06 AM
Tena Sakai
 
Posts: n/a
Default Re: postmaster.pid file

Hi Tom,

An excellent suggestion and I've just done it.
Many thanks.

Tena Sakai
tsakai@gallo.ucsf.edu


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Mon 8/13/2007 4:21 PM
To: Tena Sakai
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] postmaster.pid file

"Tena Sakai" <tsakai@gallo.ucsf.edu> writes:
> As I typed:
> ~/bin/pg_ctl -D ~/bin reload
> I thought I had typed:
> ~/bin/pg_ctl -D ~/data reload


I recommend setting up PGDATA as an environment variable, so you never
have to type it at all ...

regards, tom lane


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com