]> git.proxmox.com Git - pmg-api.git/commit
utils: postgres_admin_cmd chdir to / before running
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 1 Dec 2021 18:08:26 +0000 (19:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 3 Feb 2022 11:18:34 +0000 (12:18 +0100)
commit2808da9f119f51907f425548503674c365baf0ab
treee17fed7080aa028dd57cae7df7a40394ca6bda03
parentfca8e54c8cb2aef77f37bb471be1e9d65c4a9c05
utils: postgres_admin_cmd chdir to / before running

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@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/Utils.pm