blob: 3c6c73573742e3925f9bb3528f62706eb1bd202c (
plain) (
tree)
|
|
#!/bin/sh -
# Copyright (c) 2015 Johannes Meixner
# PROVIDE: opentsdb
# REQUIRE: LOGIN
# KEYWORD: shutdown
# opentsdb_enable (bool): Set to NO by default.
# Set it to YES to enable OpenTSDB
. /etc/rc.subr
export PATH=${PATH}:%%PREFIX%%/bin
name=opentsdb
rcvar=opentsdb_enable
load_rc_config "${name}"
: ${opentsdb_enable:=NO}
: ${opentsdb_user:=opentsdb}
: ${opentsdb_opts:=tsd 2> %%OPENTSDB_LOGDIR%%/error.log 1> %%OPENTSDB_LOGDIR%%/tsdb.log}
pidfile="%%OPENTSDB_RUNDIR%%/${name}.pid"
opentsdb_daemon="%%PREFIX%%/bin/tsdb"
procname="daemon*"
command="/usr/sbin/daemon"
command_args="-P ${pidfile} ${opentsdb_daemon} ${opentsdb_opts}"
run_rc_command "$1"
|