pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter <pmc@citylink.dinoex.sub.org>
To: Jeffrey Walton <noloader@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to make PostreSQL utilities honor home directories?
Date: Fri, 2 Sep 2022 01:04:12 +0200
Message-ID: <YxE6bFJvH35X7mAP@disp.intra.daemon.contact> (raw)
In-Reply-To: <CAH8yC8kOj0pmHF1RbK2Gb2t4YCcNG-5h0TwZ7yxk3Hzw6C0Otg@mail.gmail.com>
References: <CAH8yC8kOj0pmHF1RbK2Gb2t4YCcNG-5h0TwZ7yxk3Hzw6C0Otg@mail.gmail.com>


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).





view thread (14+ messages)  latest in thread

Message-ID: <YxE6bFJvH35X7mAP@disp.intra.daemon.contact>
Permalink:  ../YxE6bFJvH35X7mAP@disp.intra.daemon.contact/
Also on:    postgresql.org/message-id/YxE6bFJvH35X7mAP@disp.intra.daemon.contact

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pmc@citylink.dinoex.sub.org, noloader@gmail.com
  Subject: Re: How to make PostreSQL utilities honor home directories?
  In-Reply-To: <YxE6bFJvH35X7mAP@disp.intra.daemon.contact>
  References: <CAH8yC8kOj0pmHF1RbK2Gb2t4YCcNG-5h0TwZ7yxk3Hzw6C0Otg@mail.gmail.com> <YxE6bFJvH35X7mAP@disp.intra.daemon.contact>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox