Strange postgresql behaviour

Issues related to applications and software problems
Post Reply
massimo79m
Posts: 1
Joined: 2020/06/13 22:04:25

Strange postgresql behaviour

Post by massimo79m » 2020/06/13 22:08:32

Centos 8.3, postgresql 12, installed from yum.
if i start the service from systemctl, it stops with
"creation of lock file "postmaster.pid" failed: Permission denied".
instead, if i run the same command as in the postgresql.service file (postmaster -D /data/pgdata), it works. the postmaster.pid is correctly created and the server works.
the /data/pgdata is owned by postgres:postgres.

thank you in advance

User avatar
TrevorH
Forum Moderator
Posts: 29431
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Strange postgresql behaviour

Post by TrevorH » 2020/06/13 23:16:31

Are you running the CentOS version of postgresql?

Your problem is because you have moved the pgsql data directory from its standard location to somewhere that is not known by selinux. You should look at the man page for semanage, specifically the section dealing with equivalency so that you can map your /data/pgdata directory to the standard location so that all the rules then apply there too. Once that's done, run restorecon -RFv /data/pgdata to fix the selinux contexts and then it should work.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”