pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gunnar \"Nick\" Bluth <gunnar.bluth@pro-open.de>
To: Strahinja Kustudić <strahinjak@nordeus.com>
Cc: Rajagopalan, Jayashree <Jayashree.Rajagopalan@emc.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: postgres 9.0 - unable to bind to localhost.
Date: Wed, 30 Jan 2013 22:19:05 +0100
Message-ID: <51098E49.9020701@pro-open.de> (raw)
In-Reply-To: <CADKbJJVYJ7=fZ2h87b3SqVmPXCOCcASrrO483dW1ubhyqAEG4w@mail.gmail.com>
References: <672B315321EBEC4CA4B5627D112E0896067F53F7D4@MX25A.corp.emc.com>
	<672B315321EBEC4CA4B5627D112E0896067F53F7E4@MX25A.corp.emc.com>
	<CADKbJJVYJ7=fZ2h87b3SqVmPXCOCcASrrO483dW1ubhyqAEG4w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Am 23.12.2012 12:38, schrieb Strahinja Kustudić:
> Sorry for a late reply, but I had the exact same problem and it was a 
> bug in the Red Hat RPM package upgrade script of the sudo package. 
> This basically means the user running Postgres cannot resolve hostname 
> localhost. Have you tried logging in as the user running Postgres and 
> trying to resolve localhost? In RHEL/Centos you would do this with:
>
> *su - postgres*
> *nslookup localhost*
>

A late comment on this one... but I've learnt this lesson the hard way :/
If you want to know what am actual program will get, use "getent hosts 
<hostname/IP>", that will follow the directions in nsswitch.conf and 
also use an nscd, if you're running one.

So, if someone (for whatever reason) once put a line
     1.2.3.4 localhost
in your /etc/hosts, the "nslookup" will return what you'd expect (i.e., 
hopefully ;-), but Postgres will try to open a socket on 1.2.3.4. Bang!

Apart from that:
a) nslookup is deprecated since ages, use "host" or "dig" (well, no, use 
"getent hosts" ;-)
b) I doubt that all DNS possible servers (M$ ones spring to mind...) 
will provide answers to "localhost"

Just my 2p...

-- 
Gunnar "Nick" Bluth
RHCE/SCLA

Mobil   +49 172 8853339
Email: gunnar.bluth@pro-open.de
__________________________________________________________________________
In 1984 mainstream users were choosing VMS over UNIX.  Ten years later
they are choosing Windows over UNIX.  What part of that message aren't you
getting? - Tom Payne

view thread (3+ messages)

Message-ID: <51098E49.9020701@pro-open.de>
Permalink:  ../51098E49.9020701@pro-open.de/
Also on:    postgresql.org/message-id/51098E49.9020701@pro-open.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gunnar.bluth@pro-open.de, strahinjak@nordeus.com, Jayashree.Rajagopalan@emc.com
  Subject: Re: postgres 9.0 - unable to bind to localhost.
  In-Reply-To: <51098E49.9020701@pro-open.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox