#!/sbin/openrc-run # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 description="Receives StatsD-style metrics and exports them as Prometheus metrics" : ${STATSD_EXPORTER_USER:=statsd_exporter} : ${STATSD_EXPORTER_LOG:="/var/log/statsd_exporter/statsd_exporter.log"} : ${SSD_OPTS:="-1 ${STATSD_EXPORTER_LOG} -2 ${STATSD_EXPORTER_LOG}"} name="${STATSD_EXPORTER_NAME:-"StatsD Exporter"}" command="/usr/bin/statsd_exporter" command_args="${STATSD_EXPORTER_OPTS}" command_user="${STATSD_EXPORTER_USER}" command_background=true pidfile="/run/${SVCNAME}.pid" start_stop_daemon_args="${SSD_OPTS}" depend() { need net } start_pre() { checkpath -d -m 0750 -o ${STATSD_EXPORTER_USER} \ "${STATSD_EXPORTER_LOG%/*}" }