Re: How to make PostreSQL utilities honor home directories?

From: Peter <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>
To: Jeffrey Walton <noloader(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to make PostreSQL utilities honor home directories?
Date: 2022-09-01 23:04:12
Message-ID: YxE6bFJvH35X7mAP@disp.intra.daemon.contact
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Well, like others mentioned before, it is not getting fully clear
what You are trying to achieve. But, in any case, if this is Your
problem ....

On Thu, Sep 01, 2022 at 06:01:02PM -0400, Jeffrey Walton wrote:
! Hi Everyone,
!
! We are having a heck of a time getting PostreSQL utilities to honor
! home directories. For example, when I execute this script:
!
! sudo -H -u postgres PGPASSWORD=${password} \
! psql -h "${hostname}" -U "${username}" -d "${database}" \
! --command="..."
!
! It produces failures:
!
! could not change directory to "/home/jwalton/godojo": Permission denied

... this appears to me as rather a sudo issue. Because certainly
psql cannot execute /as user postgres/ in a directory where user
postgres is not allowed to enter. So sudo should fix that, and in
my sudo installation I find either a "-D directory" option for
sudo (that should change the directory accordingly) or a "--login"
option (that would run a full login shell for the user postgres,
which, alongside going to the postgres homedir, does a lot of
other things which may or may not be desireable in your installation).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2022-09-02 00:23:07 Re: How to make PostreSQL utilities honor home directories?
Previous Message Adrian Klaver 2022-09-01 22:58:47 Re: How to make PostreSQL utilities honor home directories?