1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Improve postmaster's logging of listen socket creation.

When one of the kernel calls in the socket()/bind()/listen() sequence
fails, include the specific address we're trying to bind to in the log
message.  This greatly eases debugging of network misconfigurations.

Also, after successfully setting up a listen socket, report its address
in the log, to ease verification that the expected addresses were bound.
There was some debate about whether to print this message at LOG level or
only DEBUG1, but the majority of votes were for the former.

Discussion: https://postgr.es/m/9564.1489091245@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2017-03-10 16:32:18 -05:00
parent de75281637
commit f9dfa5c977
2 changed files with 43 additions and 16 deletions

View File

@@ -464,9 +464,9 @@ su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgs
<para>
<screen>
LOG: could not bind IPv4 socket: Address already in use
LOG: could not bind IPv4 address "127.0.0.1": Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
FATAL: could not create TCP/IP listen socket
FATAL: could not create any TCP/IP sockets
</screen>
This usually means just what it suggests: you tried to start
another server on the same port where one is already running.
@@ -476,9 +476,9 @@ FATAL: could not create TCP/IP listen socket
on a reserved port number might draw something like:
<screen>
$ <userinput>postgres -p 666</userinput>
LOG: could not bind IPv4 socket: Permission denied
LOG: could not bind IPv4 address "127.0.0.1": Permission denied
HINT: Is another postmaster already running on port 666? If not, wait a few seconds and retry.
FATAL: could not create TCP/IP listen socket
FATAL: could not create any TCP/IP sockets
</screen>
</para>