aboutsummaryrefslogtreecommitdiff
path: root/databases/pgbouncer/files/pgbouncer.in
diff options
context:
space:
mode:
Diffstat (limited to 'databases/pgbouncer/files/pgbouncer.in')
-rw-r--r--databases/pgbouncer/files/pgbouncer.in37
1 files changed, 37 insertions, 0 deletions
diff --git a/databases/pgbouncer/files/pgbouncer.in b/databases/pgbouncer/files/pgbouncer.in
new file mode 100644
index 000000000000..f66379a9e238
--- /dev/null
+++ b/databases/pgbouncer/files/pgbouncer.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: pgbouncer
+# REQUIRE: LOGIN
+# BEFORE: securelevel
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable pgbouncer:
+#
+# 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=pgbouncer_enable
+
+load_rc_config "$name"
+: ${pgbouncer_enable="NO"}
+: ${pgbouncer_user="pgbouncer"}
+: ${pgbouncer_conf="%%PREFIX%%/etc/$name.ini"}
+
+extra_commands="reload"
+
+command="%%PREFIX%%/bin/pgbouncer"
+pidfile="%%PGBOUNCER_RUNDIR%%/$name.pid"
+required_files="${pgbouncer_conf}"
+command_args="-d ${pgbouncer_conf}"
+
+run_rc_command "$1"