Postgres IDENT auth problems...

From: Jens Porup <jens(at)cyber(dot)com(dot)au>
To: pgsql-admin(at)postgresql(dot)org
Subject: Postgres IDENT auth problems...
Date: 2004-07-01 03:38:44
Message-ID: 20040701033844.GA7583@vanilla.office.cyber.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


G'day,

I am trying to install Request Tracker (using Postgres) on a user-mode
linux server running Debian testing.

Installation (including database setup) runs flawlessly on my desktop
machine, but the postgres database setup fails on the server.

Correspondence on the Request Tracker mailing list seems to have
narrowed the problem to a postgres problem--if you can help me, it would
be much appreciated.

Here's the problem:

The request tracker database setup script dies trying to connect to
the database:

DBI connect('dbname=template1;host=localhost','rtuser',...) failed: could not
connect to server: Connection refused at /usr/sbin/rt-setup-database line 110

So I wrote a little Perl script to test this:

my $dsn = "dbi:Pg:dbname=template1";

###
### But this dies!!!
### my $dsn = "dbi:Pg:dbname=template1:host=localhost;";
###

my $dbh = DBI->connect($dsn, "rtuser", "wibble") or die "doh!\n";

For some reason specifying "host=localhost" in the $dsn causes everything to
die.

I can connect manually to the database, like so:

root(at)request-tracker:~# psql -d template1 -U rtuser -W
Password:
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

But it fails if I specify the host:

root(at)request-tracker:~# psql -d template1 -U rtuser -h localhost -W
Password:
psql: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?

Now before you ask:

Yes, the following lines appear uncommented in my
/etc/postgresql/postgresql.conf:

tcpip_socket = true
port = 5432

But then:

root(at)request-tracker:~# netstat -auntp

shows postmaster running on a udp port???

udp 0 0 127.0.0.1:1042 127.0.0.1:1042 ESTABLISHED18375/postmaster

A server restart shows:

root(at)request-tracker:~# /etc/init.d/postgresql restart
Stopping PostgreSQL database server: autovacuumNo pg_autovacuum found running;
none killed.
postmaster.
Starting PostgreSQL database server: postmaster autovacuum.

What is pg_autovacuum anyway? I dunno....

And finally, I *do* have lines in my pg_hba.conf file (and yes, in the correct
order) to allow my user 'rtuser' to connect to template1:

host template1 rtuser 127.0.0.1 255.255.255.255 password
local template1 rtuser password
host rtdb rtuser 127.0.0.1 255.255.255.255 password
local rtdb rtuser password

The above four lines are the first uncommented lines in the file, as directed by
request tracker's INSTALL.Debian.

I should note that for whatever reason, Debian testing seems to
mistakenly read from /var/lib/postgres/data/pg_hba.conf instead of
/etc/postgresql/pg_hba.conf. I've symlinked the two, so this is not a
cause of the problem.

I have thoroughly and completely exhausted everything I can think of for
this problem. Request Tracker using postgres is up and running
fine--straight out of the box--on my Debian testing desktop, but not the
uml server.

Something about that host=localhost thing....

Any ideas?

Thanks,

Jens

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2004-07-01 05:33:04 Re: Postgres IDENT auth problems...
Previous Message vidhya baskaran 2004-07-01 03:32:10 unsubscribe