summaryrefslogtreecommitdiff
path: root/databases/redis_exporter/files/redis_exporter.in
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2018-05-24 19:12:51 +0000
committerKurt Jaeger <pi@FreeBSD.org>2018-05-24 19:12:51 +0000
commitc27a7e99f92d48b191219c285a68113e136a7760 (patch)
treef397d5248ce3d08bb24a4510032d3a8c07083e04 /databases/redis_exporter/files/redis_exporter.in
parentaudio/madplay: Avoid accidentally building with esound backend (diff)
New port: databases/redis_exporter
Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x and 4.x WWW: https://github.com/oliver006/redis_exporter PR: 227750 Submitted by: Volodymyr Kostyrko <arcade@b1t.name>
Diffstat (limited to 'databases/redis_exporter/files/redis_exporter.in')
-rw-r--r--databases/redis_exporter/files/redis_exporter.in59
1 files changed, 59 insertions, 0 deletions
diff --git a/databases/redis_exporter/files/redis_exporter.in b/databases/redis_exporter/files/redis_exporter.in
new file mode 100644
index 000000000000..cd8e90b1de7a
--- /dev/null
+++ b/databases/redis_exporter/files/redis_exporter.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+#
+# $FreeBSD$
+#
+
+# PROVIDE: redis_exporter
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# redis_exporter_enable (bool): Set to NO by default.
+# Set it to YES to enable redis_exporter.
+# redis_exporter_user (string): Set user that redis_exporter will run under
+# Default is "nobody".
+# redis_exporter_group (string): Set group that redis_exporter will run under
+# Default is "nobody".
+# redis_exporter_args (string): Set extra arguments to pass to redis_exporter
+# Default is "".
+# redis_exporter_listen_address (string):Set ip:port that redis_exporter will listen on
+# Default is ":9121".
+# redis_exporter_server (string): Set server address to connect to
+# Default is "localhost".
+
+. /etc/rc.subr
+
+name=redis_exporter
+rcvar=redis_exporter_enable
+
+load_rc_config $name
+
+: ${redis_exporter_enable:="NO"}
+: ${redis_exporter_user:="nobody"}
+: ${redis_exporter_group:="nobody"}
+: ${redis_exporter_args:=""}
+: ${redis_exporter_listen_address:=":9121"}
+: ${redis_exporter_server:="localhost"}
+
+pidfile=/var/run/redis_exporter.pid
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/bin/redis_exporter"
+command_args="-p ${pidfile} /usr/bin/env ${procname} \
+ --redis.addr=${redis_exporter_server} \
+ --web.listen-address=${redis_exporter_listen_address} \
+ ${redis_exporter_args}"
+
+start_precmd=redis_exporter_startprecmd
+
+redis_exporter_startprecmd()
+{
+ if [ ! -e ${pidfile} ]; then
+ install -o ${redis_exporter_user} -g ${redis_exporter_group} /dev/null ${pidfile};
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"