aboutsummaryrefslogtreecommitdiff
path: root/databases/pgbouncer/files/pgbouncer.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'databases/pgbouncer/files/pgbouncer.sh.in')
-rw-r--r--databases/pgbouncer/files/pgbouncer.sh.in24
1 files changed, 13 insertions, 11 deletions
diff --git a/databases/pgbouncer/files/pgbouncer.sh.in b/databases/pgbouncer/files/pgbouncer.sh.in
index 29c4ecf65ab8..9d4c8f2cffd0 100644
--- a/databases/pgbouncer/files/pgbouncer.sh.in
+++ b/databases/pgbouncer/files/pgbouncer.sh.in
@@ -10,26 +10,28 @@
# Add the following lines to /etc/rc.conf to enable pgbouncer:
#
-# pgbouncer_enable="YES"
-# pgbouncer_flags="<set as needed>"
-#
+# pgbouncer_enable (bool): Set to "YES" to enable pgbouncer
+# Default is "NO".
+# pgbouncer_conf (path): Set full path to configuration file.
+# Default is "%%PREFIX%%/etc/pgbouncer.ini".
+# pgbouncer_flags (string): Additional flags passed to pgbouncer.
+# Default is "".
. /etc/rc.subr
name="pgbouncer"
rcvar=`set_rcvar`
+load_rc_config "$name"
+: ${pgbouncer_enable="NO"}
+: ${pgbouncer_user="pgbouncer"}
+: ${pgbouncer_conf="%%PREFIX%%/etc/$name.ini"}
+
extra_commands="reload"
command="%%PREFIX%%/bin/pgbouncer"
-config_file="%%PREFIX%%/etc/$name.ini"
-command_args="-d ${config_file}"
pidfile="%%PGBOUNCER_RUNDIR%%/$name.pid"
-required_files="${config_file}"
-
-# read configuration and set defaults
-load_rc_config "$name"
-: ${pgbouncer_enable="NO"}
-: ${pgbouncer_user="%%PGBOUNCER_USER%%"}
+required_files="${pgbouncer_conf}"
+command_args="-d ${pgbouncer_conf}"
run_rc_command "$1"