diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-08-25 10:45:55 +0100 |
commit | 3cf7c3ef441822c889356fd1812ebf2944a59851 (patch) | |
tree | c513fe68548b40365c1c2ebfe35c58ad431cdd77 /dev-db/influxdb/files/influxdb.rc-r1 | |
parent | 05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff) |
gentoo resync : 25.08.2020
Diffstat (limited to 'dev-db/influxdb/files/influxdb.rc-r1')
-rw-r--r-- | dev-db/influxdb/files/influxdb.rc-r1 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dev-db/influxdb/files/influxdb.rc-r1 b/dev-db/influxdb/files/influxdb.rc-r1 new file mode 100644 index 000000000000..7556a506784d --- /dev/null +++ b/dev-db/influxdb/files/influxdb.rc-r1 @@ -0,0 +1,45 @@ +#!/sbin/openrc-run + +config="${config:-/etc/influxdb/influxdb.conf}" +pidfile=${pidfile:-/var/run/influxd.pid} +influxd_opts=${influxd_opts:-} + +supervisor="supervise-daemon" +command=/usr/bin/influxd +command_args="-config ${config} -pidfile ${pidfile} ${influxd_opts}" +command_user="influxdb:influxdb" + +retry=SIGTERM/30/SIGKILL/10 +wait=1000 + +# Logging +error_log="${error_log:-/var/log/influxdb/influxd.log}" +output_log="${output_log:-/dev/null}" + +# Max open files +rc_ulimit="-n 65536" + +start_pre() { + # Check if config file exist + if [ ! -r "${config}" ]; then + eerror "config file ${config} doesn't exist" + return 1 + fi + if [ -n "${error_log}" ] && [ ! -e "${error_log}" ]; then + checkpath -d -o "${command_user}" "$(dirname "${error_log}")" + fi + if [ -n "${output_log}" ] && [ ! -e "${output_log}" ]; then + checkpath -d -o "${command_user}" "$(dirname "${output_log}")" + fi + return 0 +} + +if [ -n "${INFLUXDB_HEALTHCHECK_URI}" ]; then + healthcheck_delay=300 + healthcheck_timer=60 + + healthcheck() { + command -v wget || return 0 + wget -Oq- "${INFLUXDB_HEALTHCHECK_URI}" + } +fi |