Skip to content

pgSQL14.10+repmgr5.4.1 sets up a master-slave replication cluster, and the service runs normally and replicates normally. Executing systemctl start repmgrd failed #900

@LiBiao-java

Description

@LiBiao-java

I am setting up a master-slave replication cluster using pgSQL14.10+repmgr5.4.1, the service is running normally and replicating normally, executing systemctl start repmgrd.service fails. The environmental information is as follows:
The pgsql installation directory is: /data/pg14/pgsql, and the data directory is: /data/pg14/pg_data; repmgr.congf under /data/repmgr/config;
repmgr and repmgrd are both in /data/pg14/pgsql, and the repmgrrepomgrd command can be run normally. /data directory is a postgres user group with 750 permissions. Use repmgrd -f /data/repmgr/config/repmgr.conf -p /data/repmgr/repmgrd.pid -d to run normally, repmgrd service status to check repmgrd as running.
Now using systemd to manage repmgrd, startup is exceptional. repmgrd.service reads:
`[Unit]
Description=repmgr manager daemon
Documentation=https://www.repmgr.org/docs/current/repmgrd-daemon.html
After=network-online.target postgresql-14.service
Wants=network-online.target postgresql-14.service

[Service]
Type=forking

User=postgres
Group=postgres

PIDFile=/data/repmgr/repmgrd.pid
ExecStart=/data/pg14/pgsql/bin/repmgrd -f /data/repmgr/config/repmgr.conf -p /data/repmgr/repmgrd.pid -d --verbose
ExecStop=/usr/bin/kill -TERM $MAINPID
ExecReload=/usr/bin/kill -HUP $MAINPID

TimeoutStopSec=180
Restart=on-failure
RestartSec=5

TimeoutSec=300
[Install]
WantedBy=multi-user.targetAfter reloading, using sudo systemctl start repmgrd.service, the startup is exceptional. status information is as follows:sudo systemctl status repmgrd
● repmgrd.service - repmgr manager daemon
Loaded: loaded (/etc/systemd/system/repmgrd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2025-08-15 21:42:20 CST; 1min 20s ago
● repmgrd.service - repmgr manager daemon
Loaded: loaded (/etc/systemd/system/repmgrd.service; enabled; vendor preset: disabled)
Active: activating (start) since Fri 2025-08-15 21:43:56 CST; 7s ago
Docs: https://www.repmgr.org/docs/current/repmgrd-daemon.html
Process: 501920 ExecStart=/data/pg14/pgsql/bin/repmgrd -f /data/repmgr/config/repmgr.conf -p /data/repmgr/repmgrd.pid -d --verbose (code=exited, status=0/SUCCESS)
Main PID: 501791 (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 100424)
Memory: 1.1M
CGroup: /system.slice/repmgrd.service
└─501923 /data/pg14/pgsql/bin/repmgrd -f /data/repmgr/config/repmgr.conf -p /data/repmgr/repmgrd.pid -d --verbose

Aug 15 21:43:56 CNSHAAPD2002 systemd[1]: Starting repmgr manager daemon...
Aug 15 21:43:56 CNSHAAPD2002 repmgrd[501920]: [2025-08-15 21:43:56] [NOTICE] using provided configuration file "/data/repmgr/config/repmgr.conf"
Aug 15 21:43:56 CNSHAAPD2002 repmgrd[501920]: [2025-08-15 21:43:56] [NOTICE] redirecting logging output to "/data/repmgr/log/repmgrd.log"
Aug 15 21:43:56 CNSHAAPD2002 systemd[1]: repmgrd.service: Can't open PID file /data/repmgr/repmgrd.pid (yet?) after start: No such file or directory
Aug 15 21:43:56 CNSHAAPD2002 systemd[1]: repmgrd.service: Can't convert PID files /data/repmgr/repmgrd.pid O_PATH file descriptor to proper file descriptor: Permission denied
Aug 15 21:43:56 CNSHAAPD2002 systemd[1]: repmgrd.service: Can't convert PID files /data/repmgr/repmgrd.pid O_PATH file descriptor to proper file descriptor: Permission denied`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions