ports/databases/postgresql-repmgr/files/repmgrd.in
Muhammad Moinur Rahman e3788dbf2f databases/postgresql-repmgr: Update version 3.1.5=>3.3
- Daemon would better run as pgsql user, and for safety by default in
  monitor only mode [1]

PR:		212490 [1]
Submitted by:	marck [1]
2017-03-05 10:40:45 +00:00

34 lines
622 B
Bash

#!/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_user:="pgsql"}
: ${repmgrd_config="%%PREFIX%%/etc/repmgr.conf"}
command=%%PREFIX%%/sbin/${name}
pidfile=/var/run/${name}.pid
command_args="-m -d -p $pidfile -f $repmgrd_config"
run_rc_command "$1"