aboutsummaryrefslogtreecommitdiff
path: root/databases/pgbouncer/files/pgbouncer.sh.in
blob: 29c4ecf65ab879fbb3f16607e3c63df5d1ddf210 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: pgbouncer
# REQUIRE: LOGIN
# BEFORE:  securelevel
# KEYWORD: shutdown

# Add the following lines to /etc/rc.conf to enable pgbouncer:
#
# pgbouncer_enable="YES"
# pgbouncer_flags="<set as needed>"
#

. /etc/rc.subr

name="pgbouncer"
rcvar=`set_rcvar`

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%%"}

run_rc_command "$1"