You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-analyzer/kapacitor/files/kapacitor.rc

36 lines
710 B

#!/sbin/openrc-run
config=/etc/kapacitor/kapacitor.conf
pidfile=/var/run/kapacitord.pid
command=/usr/bin/kapacitord
command_args="-config ${config} ${kapacitor_opts}"
command_background=yes
make_pidfile=yes
command_user="kapacitor:kapacitor"
# Logging
error_log="${error_log:-/var/log/kapacitor/kapacitor.err}"
output_log="${output_log:-/dev/null}"
# Max open files
rc_ulimit="-n 65536"
depend() {
after net
}
start_pre() {
# Check if config file exist
if [ ! -r ${config} ]; then
eerror "config file ${config} doesn't exist"
return 1
fi
if [ ! -f "$error_log" ]; then
mkdir -p "$(dirname $error_log)"
fi
if [ ! -f "$output_log" ]; then
mkdir -p "$(dirname $output_log)"
fi
return 0
}