EnterpriseDB/repmgr

PID file directory doesn't exist when installing repmgr

Opened this issue · 2 comments

Hello,

I've noticed an issue that appears since version 5.1 in rhel7.
When installing repmgr the directory /run/repmgr should be created automatically to later hold the pid file for repmgr to run
(this happens on version 5.2 as well again rhel7).
When installing repmgr 5.1 on rhel8 it seems to work fine the directory is created.

The way to solve it for me was to just create this directory and everything works fine though I would like to understand why this issue happens.

I'm surprised nobody said something about this issue, which causes me to doubt about this that maybe its just for me.

I've checked the permissions on the directory /run and it seems the same on rhel7 and rhel8 (755 root root).

The closest issue I've found to this problem is #517 but it seems like a different issue and it's on an older repmgr version.

I'm seeing the same issue on Centos 7. Replaced 1 node in a cluster and upgraded the whole cluster from 4.4.0 to 5.2.1. The replaced node hit this issue. Also testing in a couple fresh VMs with the same issue. Both scenarios installed from the pgdg10 repo.

repmgrd[6253]: [2021-01-26 19:26:44] [INFO] connecting to database "host=X.X.X.X user=repmgr port=5432 dbn
systemd[1]: Can't open PID file /run/repmgr/repmgrd-10.pid (yet?) after start: No such file or directory
repmgrd[6253]: [2021-01-26 19:26:44] [ERROR] could not open PID file /run/repmgr/repmgrd-10.pid
systemd[1]: repmgr10.service never wrote its PID file. Failing.
audispd[2544]: node=THE_NODE_NAME type=SERVICE_START msg=audit(1611689204.2
systemd[1]: Failed to start A replication manager, and failover management tool for PostgreSQL.

It seems like the repmgr10.service file needs a RuntimeDirectory=repmgr setting. But how was that getting created before? 🤔