#!/sbin/openrc-run
supervisor=supervise-daemon

name="sachet"
description="SMS alerts for Prometheus' Alertmanager"

command=/usr/bin/sachet
command_args="-config $sachet_config_file -listen-address $sachet_listen_address"
command_user="prometheus:prometheus"

logdir="/var/log/prometheus"
output_log="$logdir/${SVCNAME}.log"
error_log="$logdir/${SVCNAME}.log"
pidfile="/var/run/${SVCNAME}.pid"

depend() {
	need net
	after firewall
}

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