Re: no password on postgres user and pgagent

From: Christoph Berg <cb(at)df7cb(dot)de>
To: "Sebastian P(dot) Luque" <spluque(at)gmail(dot)com>
Cc: pgsql-pkg-debian(at)postgresql(dot)org
Subject: Re: no password on postgres user and pgagent
Date: 2016-05-10 14:20:31
Message-ID: 20160510142030.GD7473@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

Re: Sebastian P. Luque 2016-05-10 <87d1ouvz6v(dot)fsf(at)otaria(dot)sebmel(dot)org>
> >> I'd like to run pgagent with the postgres user, which doesn't have a
> >> password. I thought it'd be as simple as setting up an init script
> >> as:
>
> >> [ -- Begin <pgagent_start.sh>
> >> ---------------------------------------------- ] #! /bin/sh
>
> >> pgagent user=postgres host=localhost dbname=postgres
>
> > The default pg_hba.conf requires md5 passwords for "host=localhost"
> > connections.
>
> It's actually set to "peer" in my case (v. 9.5):
>
> [ -- <pg_hba.conf> lines 84 - 85 ------------------------------------------- ]
> # Database administrative login by Unix domain socket
> local all postgres peer
> [ -- End of <pg_hba.conf> lines 84 - 85 ------------------------------------ ]
>
> which is what I want; i.e. get user name from the operating system user
> and check that it matches requested database user name. If I understand
> right, this means that if I sudo or login as postgres, then that's what
> PostgreSQL gets. If postgres has no password and I can login without
> one, then the database server shouldn't ask for one. Why does pgagent
> expect one?

Because you try "host=localhost" which doesn't match the line you are
citing. Look for host...md5.

Christoph

In response to

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message Sebastian P. Luque 2016-05-11 11:53:12 Re: no password on postgres user and pgagent
Previous Message Sebastian P. Luque 2016-05-10 13:07:36 Re: no password on postgres user and pgagent