#!/sbin/openrc-run # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 description="A server that export Redis metrics for Prometheus consumption" : ${REDIS_EXPORTER_USER:=redis_exporter} : ${REDIS_EXPORTER_LOG:="/var/log/redis_exporter/redis_exporter.log"} : ${SSD_OPTS:="-1 ${REDIS_EXPORTER_LOG} -2 ${REDIS_EXPORTER_LOG}"} name="${REDIS_EXPORTER_NAME:-"Redis Exporter"}" command="/usr/bin/redis_exporter" command_args="${REDIS_EXPORTER_OPTS}" command_user="${REDIS_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 ${REDIS_EXPORTER_USER} \ "${REDIS_EXPORTER_LOG%/*}" }