[pmg-devel] applied: [PATCH pmg-api v2] utils: postgres_admin_cmd chdir to / before running

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 3 12:35:13 CET 2022


On 01.12.21 19:08, Stoiko Ivanov wrote:
> postgres_admin_cmd switches user to the postgres user.
> 
> When running a cli command in `/root` (or any other directory not
> accessible by the postgres user) this causes:
> 
> `could not change directory to "/root": Permission denied`
> 
> to be printed multiple times on stderr for those invocations, which is
> confusing and has caused quite a few support requests.
> 
> modifying the postgres_admin_cmd invocation only should not cause any
> future surprises
> 
> quickly tested with `pmgconfig sync`
> 
> Reported-by: Oguz Bektas <o.bektas at proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> v1->v2:
> * changed to only cd'ing for the problematic postgres_admin_cmd, after
>   a chat with Thomas - huge thanks!
> 
>  src/PMG/Utils.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
>

applied, thanks! Added $! to the error messages in a followup so that the
user/we gets more context wrt. the error.




More information about the pmg-devel mailing list