summaryrefslogtreecommitdiff
path: root/dev-db/influxdb/files/influxdb.initd
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2020-08-27 13:25:47 -0500
committerWilliam Hubbs <williamh@gentoo.org>2020-08-27 13:31:09 -0500
commit4f8616e5df31d7cb99177518bf2ba439fcee25e3 (patch)
treef59fc992442bccd3ee0e11e431679aa025ac8530 /dev-db/influxdb/files/influxdb.initd
parenta19b3c5e7acaa10e6eff2d2d16e519cd79a103d5 (diff)
downloadgentoo-4f8616e5df31d7cb99177518bf2ba439fcee25e3.tar.gz
gentoo-4f8616e5df31d7cb99177518bf2ba439fcee25e3.tar.bz2
gentoo-4f8616e5df31d7cb99177518bf2ba439fcee25e3.zip
dev-db/influxdb: 1.8.2 bump
Closes: https://bugs.gentoo.org/679396 Closes: https://bugs.gentoo.org/734318 Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'dev-db/influxdb/files/influxdb.initd')
-rw-r--r--dev-db/influxdb/files/influxdb.initd48
1 files changed, 48 insertions, 0 deletions
diff --git a/dev-db/influxdb/files/influxdb.initd b/dev-db/influxdb/files/influxdb.initd
new file mode 100644
index 000000000000..1987c5237612
--- /dev/null
+++ b/dev-db/influxdb/files/influxdb.initd
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+
+# Logging
+error_log="${error_log:-/var/log/influxdb/influxd.log}"
+output_log="${output_log:-/dev/null}"
+
+config="${config:-/etc/influxdb/influxdb.conf}"
+influxd_opts=${influxd_opts:-}
+
+command=/usr/bin/influxd
+command_args="-config ${config} ${influxd_opts}"
+command_user="influxdb:influxdb"
+extra_commands="version"
+
+retry=SIGTERM/30/SIGKILL/10
+supervisor="supervise-daemon"
+
+# 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
+}
+
+version() {
+ $command version
+}
+
+if [ -n "${INFLUXDB_HEALTHCHECK_URI}" ]; then
+ healthcheck_delay=300
+ healthcheck_timer=60
+
+ healthcheck() {
+ command -v wget || return 0
+ wget -Oq- "${INFLUXDB_HEALTHCHECK_URI}"
+ }
+fi