After installing postgres-9.3
via yum
in my CentOS 7
, its default configuration puts socket in /tmp
directory. I have httpd
(installed via yum
as well) which is by default managed by system.d
with PrivateTmp
option enabled. This means that any web application running on httpd
can't access /tmp
so connect to postgres
. I have changed postgres configuration so it should put its socket in /var/run/postgres
just like in Ubuntu
.
Now the problem is, that postgres
doesn't have enough privileges to write to /var/run
. My first though was to do just:
chown postgres:postgres /var/run/postgres
But /var/run
directory is cleaned after reboot so this won't work. My question is:
How to grant access to /var/run/postgres
for postgres
user in such a way that will persist reboots? I don't want to change socket location and I don't want to change httpd
's system.d
configuration. I just want postgres
to be able to write to /var/run/postgres
. Any help is much appreciated.