My Oracle Support Banner

OLVM: rh-postgresql95-postgresql.service Fails to Start: pg_ctl: could not open PID file "/var/opt/rh/rh-postgresql95/lib/pgsql/data/postmaster.pid": Permission denied (Doc ID 2662447.1)

Last updated on MAY 11, 2020

Applies to:

Linux OS - Version Oracle Linux 7.6 with Unbreakable Enterprise Kernel [4.14.35] and later
Linux x86-64

Symptoms

The rh-postgresql95-postgresql.service fails to start: pg_ctl: could not open PID file "/var/opt/rh/rh-postgresql95/lib/pgsql/data/postmaster.pid": Permission denied
# netstat -tpl | grep 5432
tcp 0 0 0.0.0.0:54323 0.0.0.0:* LISTEN 5503/python2

# systemctl list-units | grep rh-postgresql95-postgresql.service
● rh-postgresql95-postgresql.service loaded failed failed PostgreSQL database server

# systemctl restart rh-postgresql95-postgresql.service
Job for rh-postgresql95-postgresql.service failed because the control process exited with error code. See "systemctl status rh-postgresql95-postgresql.service" and "journalctl -xe" for details.

# systemctl status rh-postgresql95-postgresql.service
● rh-postgresql95-postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/rh-postgresql95-postgresql.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-04-22 11:36:24 NZST; 1s ago
Process: 5536 ExecStart=/opt/rh/rh-postgresql95/root/usr/libexec/postgresql-ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT} (code=exited, status=1/FAILURE)
Process: 5532 ExecStartPre=/opt/rh/rh-postgresql95/root/usr/libexec/postgresql-check-db-dir %N (code=exited, status=0/SUCCESS)

Apr 22 11:36:24 ovirt-engine.oracle.com systemd[1]: Starting PostgreSQL database server...
Apr 22 11:36:24 ovirt-engine.oracle.com systemd[1]: rh-postgresql95-postgresql.service: control process exited, code=exited status=1
Apr 22 11:36:24 ovirt-engine.oracle.com systemd[1]: Failed to start PostgreSQL database server.
Apr 22 11:36:24 ovirt-engine.oracle.com systemd[1]: Unit rh-postgresql95-postgresql.service entered failed state.
Apr 22 11:36:24 ovirt-engine.oracle.com systemd[1]: rh-postgresql95-postgresql.service failed.

# journalctl -xe
(snip)
Apr 22 12:13:53 ovirt-engine.oracle.com systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit rh-postgresql95-postgresql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rh-postgresql95-postgresql.service has begun starting up.
(snip)
Apr 22 12:13:53 ovirt-engine.oracle.com postgresql-ctl[20690]: pg_ctl: could not open PID file "/var/opt/rh/rh-postgresql95/lib/pgsql/data/postmaster.pid": Permission denied
Apr 22 12:13:53 ovirt-engine.oracle.com systemd[1]: rh-postgresql95-postgresql.service: control process exited, code=exited status=1
Apr 22 12:13:53 ovirt-engine.oracle.com systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit rh-postgresql95-postgresql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rh-postgresql95-postgresql.service has failed.
--
-- The result is failed.
Apr 22 12:13:53 ovirt-engine.oracle.com systemd[1]: Unit rh-postgresql95-postgresql.service entered failed state.
Apr 22 12:13:53 ovirt-engine.oracle.com systemd[1]: rh-postgresql95-postgresql.service failed.

 

Relevant file/directory permissions are correct:
# ll /var/opt/rh/rh-postgresql95/lib/pgsql/data/postmaster.pid
-rw-------. 1 postgres postgres 106 Apr 23 2019 /var/opt/rh/rh-postgresql95/lib/pgsql/data/postmaster.pid

# ll -d /var/run/postgresql/
drwxr-xr-x. 2 postgres postgres 40 Apr 23 12:33 /var/run/postgresql/

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.