postmaster of 7.0.3 listening but pslq cannot connect

Started by Nonameover 25 years ago5 messagesgeneral
Jump to latest
#1Noname
100.179370@germanynet.de

Hi,

on Nov 19 15:51:12 2000 my postmaster (7.0.3 compiled on linux
2.0.38 with gcc 2.95 in an libc5 environment) entered production
state. My machine is my home office machine. Im playing with
PostgreSQL and Perl. On Nov 30, early in the morning, postmaster
did it's last connect with an postgreSQL frontend (Perl DBI),
which is done as cronjob every night.

Now, postmaster is listening, I can connect with telnet, netstat
tells that there is a connection, but psql fails to connect to
any database. The shared memory segments of owner postgres are
still there. There is no entry in the servers log file.

What has happend to postmaster?

Any ideas?

Why does postmaster doesn't write time stamps in his log output?

Martin

--
Dipl-Ing. Martin Jacobs
Registered Linux User #87175, http://counter.li.org/

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Noname (#1)
Re: postmaster of 7.0.3 listening but pslq cannot connect

Martin Jacobs writes:

Now, postmaster is listening, I can connect with telnet, netstat
tells that there is a connection, but psql fails to connect to
any database.

What did you do and what response did you get?

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#3Noname
100.179370@germanynet.de
In reply to: Peter Eisentraut (#2)
Re: postmaster of 7.0.3 listening but pslq cannot connect

Peter Eisentraut schrieb:

Martin Jacobs writes:

Now, postmaster is listening, I can connect with telnet, netstat
tells that there is a connection, but psql fails to connect to
any database.

What did you do and what response did you get?

Nothing serious. I just wanted to test, if I could establish a
connection. I do not know how to get a valuable response. As far
as I remember, I typed something, hit ENTER and got some response
and the connection was closed by postmaster.

Sorry, ...

Now, after restarting postmaster everything is ok again.

But the question remains: what did happen to postmaster? What can
I do, if this happens again?

Any idea?

...

Martin Jacobs

--
Dipl-Ing. Martin Jacobs
Registered Linux User #87175, http://counter.li.org/

#4Noname
100.179370@germanynet.de
In reply to: Peter Eisentraut (#2)
Re: postmaster of 7.0.3 listening but pslq cannot connect - solved

Hi,

Peter Eisentraut schrieb:

Martin Jacobs writes:

Now, postmaster is listening, I can connect with telnet, netstat
tells that there is a connection, but psql fails to connect to
any database.

Solution is:

postmaster generates a socket file in dir /tmp named
.s.PGSQL.5432 This file is the culprit. I have a daily cron job
running, which removes aged files in /tmp. The socket file isn't
changed after coming to life, so my remove job deletes it. This
is the reason why psql can't connect to postmaster.

Ok, I can change my cleanup script. But wouldn't it be better to
hide the socket file in a subdirectory as it is done by the X11 font
server and X11: They write their socket files in subdirectories
/tmp/.font-unix and /tmp/.X11-unix

Suggestion: /tmp/.postgres

Comments?

What did you do and what response did you get?
...

Martin Jacobs

--
Dipl-Ing. Martin Jacobs * Windsbach * 100.179370@germanynet.de und
martin.jacobs@an-netz.de
Registered Linux User #87175, http://counter.li.org/

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#4)
Re: postmaster of 7.0.3 listening but pslq cannot connect - solved

100.179370@germanynet.de (Martin Jacobs) writes:

Suggestion: /tmp/.postgres

See the many, many past discussions of just this point.

The bottom line here is any change in the socket file location will
cause compatibility problems (as in, all your old clients stop working).

7.1 does allow the socket file location to be changed, either at
build time or as a runtime option, but I'm afraid to change the
default value...

regards, tom lane