blob: ded6ed6cc11237821abdd37f04ad312ba430e602 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
# 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 "".
# pgbouncer_sig_stop (str): Default to "TERM"
. /etc/rc.subr
name="pgbouncer"
rcvar=pgbouncer_enable
load_rc_config "$name"
: ${pgbouncer_enable="NO"}
: ${pgbouncer_user="pgbouncer"}
: ${pgbouncer_conf="%%PREFIX%%/etc/$name.ini"}
gracefulstop_cmd="pgbouncer_gracefulstop"
stop_precmd="pgbouncer_prestop"
extra_commands="reload gracefulstop"
command="%%PREFIX%%/bin/pgbouncer"
pidfile="%%PGBOUNCER_RUNDIR%%/$name.pid"
required_files="${pgbouncer_conf}"
command_args="-d ${pgbouncer_conf}"
pgbouncer_gracefulstop()
{
echo "Performing a graceful stop:"
sig_stop="INT"
run_rc_command ${rc_prefix}stop ${rc_extra_args} || return 1
}
pgbouncer_prestop()
{
sig_stop="${pgbouncer_sig_stop:-TERM}"
}
run_rc_command "$1"
|