The following bug has been logged on the website:
Bug reference: 13959
Logged by: Jakov Sosic
Email address: jsosic@gmail.com
PostgreSQL version: 9.4.1
Operating system: CentOS 7
Description:
Systemd on EL7 and probably some Debian based distributions has service
called systemd-tmpfiles-clean. That service deletes everything from /tmp
that's not excluded via special files.
PgSQL stores socket under /tmp by default, and systemd-tmpfiles-clean can
actually delete it. To avoid this, PGSQL packages should bring a file which
excludes it's socket from being deleted by tmpfiles-clean.
This is an example of file:
cat >> /usr/lib/tmpfiles.d/postgresql.conf <<EOF
# systemd tmpfiles exclude file for pgsql
# pgsql software unfortunately stores some important files
# in /tmp which should not be deleted
# Exclude pgsql socket and lock files
x /tmp/.s.PGSQL.*
EOF