Created
May 5, 2016 16:48
-
-
Save themartorana/964555e4faf84e4d6f0110c9d72542b5 to your computer and use it in GitHub Desktop.
dogstatsd rc.d file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# $FreeBSD$ | |
# PROVIDE: dogstatsd | |
# KEYWORD: shutdown | |
. /etc/rc.subr | |
name=dogstatsd | |
rcvar=${name}_enable | |
: ${dogstatsd_enable:="NO"} | |
: ${dogstatsd_user:="datadog"} | |
: ${dogstatsd_group:="datadog"} | |
: ${dogstatsd_script_path:="/usr/local/lib/python2.7/site-packages/datadog"} | |
: ${dogstatsd_interpreter:="/usr/local/bin/python"} | |
load_rc_config $name | |
start_cmd="${name}_start" | |
stop_cmd="${name}_stop" | |
restart_cmd="${name}_restart" | |
info_cmd="${name}_info" | |
status_cmd="${name}_status" | |
extra_commands="info status" | |
pidfile="/var/run/datadog/dogstatsd.pid" | |
dogstatsd_start() | |
{ | |
cd ${dogstatsd_script_path} | |
${dogstatsd_interpreter} dogstatsd.py start | |
} | |
dogstatsd_stop() | |
{ | |
cd ${dogstatsd_script_path} | |
${dogstatsd_interpreter} dogstatsd.py stop | |
} | |
dogstatsd_restart() | |
{ | |
cd ${dogstatsd_script_path} | |
${dogstatsd_interpreter} dogstatsd.py restart | |
} | |
dogstatsd_info() | |
{ | |
cd ${dogstatsd_script_path} | |
${dogstatsd_interpreter} dogstatsd.py info | |
} | |
dogstatsd_status() | |
{ | |
cd ${dogstatsd_script_path} | |
${dogstatsd_interpreter} dogstatsd.py status | |
} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment