blob: d953e3645e87083cfc61bb0b6850c996d2fb9511 (
plain)
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
|
# PROVIDE: carbonapi
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable carbonapi
# carbonapi_enable="YES"
#
# carbonapi_enable (bool): Set to YES to enable carbonapi
# Default: NO
# carbonapi_conf (str): carbonapi configration file
# Default: empty
# carbonapi_user (str): carbonapi daemon user
# Default: carbon
# carbonapi_group (str): carbonapi daemon group
# Default: carbon
. /etc/rc.subr
name="carbonapi"
rcvar=carbonapi_enable
load_rc_config $name
: ${carbonapi_enable:="NO"}
: ${carbonapi_user:="carbon"}
: ${carbonapi_group:="carbon"}
: ${carbonapi_conf:=""}
: ${carbonapi_options:="-config ${carbonapi_conf}"}
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/bin/carbonapi"
command=/usr/sbin/daemon
command_args="-f -c -p ${pidfile} ${procname} ${carbonapi_options}"
start_precmd="carbonapi_precmd"
carbonapi_precmd()
{
install -o ${carbonapi_user} /dev/null ${pidfile}
}
run_rc_command "$1"
|