summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2016-12-15 13:47:22 +0100
committerManuel Rüger <mrueg@gentoo.org>2016-12-15 13:47:59 +0100
commitfdfbc484bade7fc9f2f8140c9f8e1e7bb2ec0e1f (patch)
treea9e35187153e4e63984f4355e90a0e098db25a46 /net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd
parentsys-libs/pam: Added sub-slot dep for sys-libs/db. (diff)
downloadgentoo-fdfbc484bade7fc9f2f8140c9f8e1e7bb2ec0e1f.tar.gz
gentoo-fdfbc484bade7fc9f2f8140c9f8e1e7bb2ec0e1f.tar.bz2
gentoo-fdfbc484bade7fc9f2f8140c9f8e1e7bb2ec0e1f.zip
net-analyzer/prometheus-node_exporter: Initial version
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd')
-rw-r--r--net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd25
1 files changed, 25 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd
new file mode 100644
index 000000000000..7f2256cb6ff9
--- /dev/null
+++ b/net-analyzer/prometheus-node_exporter/files/prometheus-node_exporter.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Prometheus machine metrics exporter"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-prometheus-exporter}
+group=${group:-prometheus-exporter}
+
+command="/usr/bin/prometheus-node_exporter"
+command_args="${command_args:--collector.textfile.directory=/etc/prometheus-exporter}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/prometheus-exporter/${SVCNAME}.log \
+ --stderr /var/log/prometheus-exporter/${SVCNAME}.log"
+
+depend() {
+ need net
+ after net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}