From c74922e73fdd8f739827698443815598cc583cc5 Mon Sep 17 00:00:00 2001 From: Matthew Seaman Date: Tue, 18 Nov 2014 15:47:34 +0000 Subject: * Drop the patches replacing strnlen() -- this function is available in libc for all currently supported versions of FreeBSD. * Install the default config file into ${PREFIX}/etc/repmgr.conf.sample and uses the standard @sample plist functionality. This is where hier(7) expects config files to be installed. * Add an rc.d script to start up repmgrd automatically on system boot, which relies on the config file being in ${PREFIX}/etc/. PR: 195106 Submitted by: matthew Approved by: 5u623l20@gmail.com (maintainer) --- databases/postgresql-repmgr/files/patch-config.c | 11 -------- databases/postgresql-repmgr/files/patch-repmgr.c | 11 -------- databases/postgresql-repmgr/files/repmgrd.in | 33 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 22 deletions(-) delete mode 100644 databases/postgresql-repmgr/files/patch-config.c delete mode 100644 databases/postgresql-repmgr/files/patch-repmgr.c create mode 100644 databases/postgresql-repmgr/files/repmgrd.in (limited to 'databases/postgresql-repmgr/files') diff --git a/databases/postgresql-repmgr/files/patch-config.c b/databases/postgresql-repmgr/files/patch-config.c deleted file mode 100644 index e13f48a80521..000000000000 --- a/databases/postgresql-repmgr/files/patch-config.c +++ /dev/null @@ -1,11 +0,0 @@ ---- ./config.c.orig 2012-12-04 19:40:15.395225527 +1100 -+++ ./config.c 2012-12-04 19:40:38.975104852 +1100 -@@ -77,7 +77,7 @@ - fclose (fp); - - /* Check config settings */ -- if (strnlen(options->cluster_name, MAXLEN)==0) -+ if (strlen(options->cluster_name)==0) - { - fprintf(stderr, "Cluster name is missing. " - "Check the configuration file.\n"); diff --git a/databases/postgresql-repmgr/files/patch-repmgr.c b/databases/postgresql-repmgr/files/patch-repmgr.c deleted file mode 100644 index 380d8fe43059..000000000000 --- a/databases/postgresql-repmgr/files/patch-repmgr.c +++ /dev/null @@ -1,11 +0,0 @@ ---- repmgr.c.orig 2014-03-17 21:27:40.000000000 +0800 -+++ repmgr.c 2014-05-24 17:55:10.996404127 +0800 -@@ -1871,7 +1871,7 @@ - char host_string[MAXLEN]; - int r; - -- if (strnlen(options.rsync_options, MAXLEN) == 0) -+ if (strlen(options.rsync_options) == 0) - maxlen_snprintf( - rsync_flags, "%s", - "--archive --checksum --compress --progress --rsh=ssh"); diff --git a/databases/postgresql-repmgr/files/repmgrd.in b/databases/postgresql-repmgr/files/repmgrd.in new file mode 100644 index 000000000000..33f7b336890c --- /dev/null +++ b/databases/postgresql-repmgr/files/repmgrd.in @@ -0,0 +1,33 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: repmgrd +# REQUIRE: postgresql +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf to enable this +# service: +# +# repmgrd_enable (bool): Set to YES to enable repmgrd. Default: NO +# +# repmgrd_config (path): Default: %%PREFIX%%/etc/repmgr.conf +# + +. /etc/rc.subr + +name=repmgrd +rcvar=repmgrd_enable + +load_rc_config $name + +: ${repmgrd_enable:="NO"} +: ${repmgrd_config="%%PREFIX%%/etc/repmgr.conf"} + +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid + +command_args="-p $pidfile -f $repmgrd_config" + +run_rc_command "$1" + -- cgit v1.2.3