diff options
Diffstat (limited to 'net-analyzer/kapacitor/files')
-rw-r--r-- | net-analyzer/kapacitor/files/kapacitor.confd | 12 | ||||
-rw-r--r-- | net-analyzer/kapacitor/files/kapacitor.rc | 35 |
2 files changed, 47 insertions, 0 deletions
diff --git a/net-analyzer/kapacitor/files/kapacitor.confd b/net-analyzer/kapacitor/files/kapacitor.confd new file mode 100644 index 000000000000..d58906ae3e7a --- /dev/null +++ b/net-analyzer/kapacitor/files/kapacitor.confd @@ -0,0 +1,12 @@ +#The convention in this file is to show the default setting commented +#out. +#To change the setting, uncomment it then change the value. + +#This is the kapacitor error log: +#error_log="/var/log/kapacitor/kapacitor.log" + +#This is the kapacitor output log: +#output_log="/dev/null" + +# Extra options to pass to kapacitord: +#kapacitor_opts="" diff --git a/net-analyzer/kapacitor/files/kapacitor.rc b/net-analyzer/kapacitor/files/kapacitor.rc new file mode 100644 index 000000000000..b89d0b1cbf92 --- /dev/null +++ b/net-analyzer/kapacitor/files/kapacitor.rc @@ -0,0 +1,35 @@ +#!/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 +} |