Re: Issues with systemd unit file for repmgr - Mailing list pgsql-pkg-yum

From Simon Oxwell
Subject Re: Issues with systemd unit file for repmgr
Date
Msg-id 55A4A661.1080204@funnelback.com
Whole thread Raw
In response to Re: Issues with systemd unit file for repmgr  (Devrim GÜNDÜZ <devrim@gunduz.org>)
List pgsql-pkg-yum
On 6/07/2015 12:56 am, Devrim GÜNDÜZ wrote:
After a bit of hacking, I've got a version that's working and is a
little more flexible with some some of the extra command line options 
of repmgrd. What's the best way of sharing it back to team? As a 
patch file or as a pull request?
You can do both, I personally prefer the patch in the mailing list.


Hi Devrim,

I also ran into problems with repmgrd running as the repmgr user that gets created in the specfile. It was unable to promote the standby database to a master, because it wasn't running at the postgres user. All the of the examples that are part of the documentation for repmgr specify running them as the postgres user.

As a result my unit file runs repmgrd as postgres. I did have to chown /var/log/repmgr to be owned by postgres:postgres as the specfile creates it as repmgr:repmgr.

Other changes:
  • moved most of the environment variables out to a sysconfig file (/etc/sysconfig/repmgr94). This let me change options as well, rather than having to edit the unit file. Much easier to be able to manipulate with something like puppet, and can be sourced by the SysV init script as well.
  • used a PIDFile directive. This unfortunately required hardcoding the location of the PID file twice in the unit file, as PIDFile only takes an absolute pathname or it throws an error. Without this, systemd can't seem to guess the PID correctly when it comes to shutting down.

Hope this is of use.

The other issue I have is that repmgr can't actually parse the sample config file that the package makes the default config file, but I'm working on a patch to submit to 2nd Quadrant for that.

(Just for reference, I'm using the repmgr94 package with Postgresql94)


Thanks,

Simon

Attachment

pgsql-pkg-yum by date:

Previous
From: Devrim GÜNDÜZ
Date:
Subject: Re: 2.1.8 Update?
Next
From: Mark Wong
Date:
Subject: Re: adding a new platform