#!/sbin/openrc-run

name="apcupsd_exporter"
description="apcupsd exporter for the prometheus monitoring system"
supervisor="supervise-daemon"
command="/usr/bin/apcupsd_exporter"
command_user="prometheus:prometheus"
command_background="yes"
pidfile="/run/${RC_SVCNAME}.pid"

logdir="/var/log/prometheus"
output_log="$logdir/${RC_SVCNAME}.log"
error_log="$logdir/${RC_SVCNAME}.log"

start_pre() {
	checkpath -d -o $command_user -m 755 "$logdir"
	checkpath -f -o $command_user -m 644 "$output_log"
	checkpath -f -o $command_user -m 644 "$error_log"
}
