Centos 8.3, postgresql 12 (i tried even 10, same thing).
I have set
the permission of the data directory to
postgres:postgres. If I start
the service from
systemctl, it gives me the error message
"creation of lock file "postmaster.pid" failed: Permission denied".
If I copy the command from
postgresql.service which is
postmaster -D /data/pgdata and I run from the console as
postgres user, it works, and the
postmaster.pidfile is correctly created.
I have no ideas, because it's not a permission problem...
What am I missing?