Closed sethgoldin closed 6 years ago
It looks like since the authentication method is trust
, the .pgpass
file is totally unnecessary here: https://www.postgresql.org/docs/9.5/static/auth-methods.html#AUTH-TRUST
Given that that these three lines use /home/$USER/.pgpass
and the script is being run with sudo
, I'm thinking that fixing this should be as simple as switching the code to /$HOME/.pgpass, so that it invokes the actual non-root user, even while using sudo
.
https://github.com/sethgoldin/davinci-resolve-postgresql-workflow-tools/blob/6bae260822e7a9715656b477b83486b34b71246f/centos-automate-workflow.sh#L77 https://github.com/sethgoldin/davinci-resolve-postgresql-workflow-tools/blob/6bae260822e7a9715656b477b83486b34b71246f/centos-automate-workflow.sh#L78 https://github.com/sethgoldin/davinci-resolve-postgresql-workflow-tools/blob/6bae260822e7a9715656b477b83486b34b71246f/centos-automate-workflow.sh#L79
Bingo!
On Linux, upon running the
centos-automate-workflow.sh
script withsudo
, the script seems to check for.pgpass
in the wrong spot, in/home/root/
, and throws the following error:It might be unnecessary though, since the
pg_hba.conf
file is already set up to just usetrust
authentication.Will see about completely eliminating the step for creating a
.pgpass
file.