Re: Pgagent is not reading pgpass file either in Windows or Linux.

From: George Neuner <gneuner2(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Pgagent is not reading pgpass file either in Windows or Linux.
Date: 2018-05-31 00:45:27
Message-ID: ppfugdp0kau1a9178injuk52b0eqg29i3o@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 29 May 2018 13:32:46 -0700, Adrian Klaver
<adrian(dot)klaver(at)aklaver(dot)com> wrote:

>On 05/29/2018 12:14 PM, nageswara Bandla wrote:
>
>> As per the link-
>> (https://www.postgresql.org/docs/9.6/static/libpq-pgpass.html) I set
>> PGPASSFILE environment variable to point to pgpass.conf location. Even
>> then, it’s throwing same above error message. I have found out that
>> pgagent is not reading pgpass.conf file when configured under
>> LocalSystem account.
>>
>> When I change the properties of the pgagent service to run under my
>> login user account. Then, it’s reading pgpass.conf file under
>> %APPDATA%/postgresql/pgpass.conf.
>>
>> I am clueless, why pgagent is not honoring PGPASSFILE env variable.
>
>My guess because the LocalSystem user does not have permissions on your:
>
>%APPDATA%/postgresql/pgpass.conf
>
>file. This seems to be confirmed by it working when you run pgagent as
>the login user.

LocalSystem has administrator permissions to virtually everything.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684190(v=vs.85).aspx

It should be able to read files belonging to any user.

But the LocalSystem account can see only *global* environment
variables ... it can't see any user specific ones. I would check if
the PGPASSFILE variable is set globally or only in the user account.

I don't know anything specifically about running pgagent on Windows,
so I can't say why it is giving an error if the docs say it should
not.

George

>passfile
>
> Specifies the name of the file used to store passwords (see Section
>33.15). Defaults to ~/.pgpass, or %APPDATA%\postgresql\pgpass.conf on
>Microsoft Windows. (No error is reported if this file does not exist.)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tango ward 2018-05-31 03:24:06 Insert UUID GEN 4 Value
Previous Message Tim Cross 2018-05-30 22:31:02 Re: LDAP authentication slow