#!/sbin/openrc-run # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 description="A server that accepts Graphite metrics for Prometheus consumption" : ${GRAPHITE_EXPORTER_USER:=graphite_exporter} : ${GRAPHITE_EXPORTER_LOG:="/var/log/graphite_exporter/graphite_exporter.log"} : ${SSD_OPTS:="-1 ${GRAPHITE_EXPORTER_LOG} -2 ${GRAPHITE_EXPORTER_LOG}"} name="${GRAPHITE_EXPORTER_NAME:-"Graphite Exporter"}" command="/usr/bin/graphite_exporter" command_args="${GRAPHITE_EXPORTER_OPTS}" command_user="${GRAPHITE_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 ${GRAPHITE_EXPORTER_USER} \ "${GRAPHITE_EXPORTER_LOG%/*}" }