ccb3a11c4c
like counters and timers, sent over UDP and sends aggregates to one or more pluggable backend services (e.g., Graphite). WWW: https://github.com/etsy/statsd PR: ports/171855 Submitted by: kimor79@yahoo.com
40 lines
890 B
Bash
40 lines
890 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: statsd
|
|
# REQUIRE: NETWORK
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following line to /etc/rc.conf to enable mysql:
|
|
# statsd_enable (bool): Set to "NO" by default.
|
|
# Set it to "YES" to enable statsd.
|
|
# statsd_config (str): Default to "%%PREFIX%%/etc/statsd.js"
|
|
# Statsd configuration file.
|
|
# statsd_user (str): Default to "statsd".
|
|
# User to run as.
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=statsd
|
|
rcvar=statsd_enable
|
|
load_rc_config $name
|
|
|
|
# set defaults
|
|
: ${statsd_enable:=NO}
|
|
: ${statsd_config="%%PREFIX%%/etc/statsd.js"}
|
|
: ${statsd_user="%%USERS%%"}
|
|
|
|
pidfile="/var/run/statsd/${name}.pid"
|
|
|
|
required_files="${statsd_config}"
|
|
|
|
command=/usr/sbin/daemon
|
|
command_args="-cf -p ${pidfile} %%PREFIX%%/bin/node %%DATADIR%%/stats.js ${statsd_config}"
|
|
procname="${name}"
|
|
stop_postcmd="rm -f $pidfile"
|
|
start_precmd="install -d -o statsd -g statsd ${pidfile%/*}"
|
|
|
|
run_rc_command "$1"
|