su -m keeps root’s HOME, and psql notices 0 ▲ Dan Langille's Other Diary 56 minutes ago · Tech · hide In February 2024 I wrote about could not open certificate file “/root/.postgresql/postgresql.crt”: Permission denied. I fixed it by adding sslcertmode=disable to the connection string, and ended with: does anyone know why this might have happened? That fix has been copied into several scripts since, for example the one in Why does this PostgreSQL \copy fail when launched by the daemon? Tonight I hit it again, and this time the cause was plain to see. I was running one of the ingress scripts by hand, as the freshports user, on dvl-ingress01: [0:19 dvl-ingress01 dvl ~/scripts] % sudo su -fm freshports -c 'cd /usr/local/libexec/freshports && ./categories_rebuild_search_html.sh' psql: error: connection to server at "pg01.int.unixathome.org" (10.55.0.150), port 5432 failed: could not open certificate file "/root/.postgresql/postgresql.crt": Permission denied Why is the freshports user looking in /root? Because of the -m. su -m leaves the environment alone, and that includes HOME. I started… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town