pgAgent and pgpass

From: Barry Schatz <barry(dot)schatz(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: pgAgent and pgpass
Date: 2010-04-27 15:19:31
Message-ID: w2sc96428941004270819h897e0076gff1afe972cb4520f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

I didn't receive a copy of my post from yesterday so I'm having to write
this as if it were a new post rather than a follow-up (keeping same subject
line).

FYI: I overcame the problem of pgAgent not reading .pgpass by eliminating
the host address from the arguments, thus:

DAEMON_ARGS="-l 1 -s /var/log/postgresql/pgagent.log port=6543
dbname=postgres user=postgres"

Why did this work? I'm not sure. It would be helpful if someone more
knowledgeable could chime in and correct my discovery that, apparently,
.pgpass works only in a UNIX socket context. Surely that is wrong, but when
I deleted the host address argument pgAgent could use .pgpass via login by
UNIX sockets, with the following line set in pg_hba.conf:

local all postgres ident

I tested this by commenting out this line and restarting postgresql and
pgagent, whose log then recorded:

WARNING: Couldn't create connection: FATAL: no pg_hba.conf entry for host
"[local]", user "postgres", database "postgres", SSL off
WARNING: Couldn't create connection: could not connect to server: No such
file or directory
Is the server running locally and accepting
connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.6543"?

But as to why .pgpass was not read by pgAgent when I first tried to use an
IPv4 host address I don't know.

Many will ask why I wasn't using 127.0.0.1 and it's because this
configuration is on a virtual server where localhost and 127.0.0.1 are not
available, leaving only the assigned IP address. And... pgAgent doesn't see
the .pgpass file when I used that option.

Can anybody shed more light on this discovery?

BTW I also deleted the pidfile option from the Debian init script, but if
anyone has a more expert Debian init script for pgAgent than my woeful
example, please post it. Thanks.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2010-04-27 15:32:27 Re: pgAgent and pgpass
Previous Message Guillaume Lelarge 2010-04-27 13:56:17 Re: revoke select right on pg_proc