#!/sbin/openrc-run

name=hledger-web
command="/usr/bin/$name"
command_args="${command_args:---serve}"
command_background="yes"
command_user="hledger"
pidfile="/run/$name.pid"
output_log="/var/log/$name"
error_log="$output_log"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -F -o $command_user:$command_user \
		/var/log/$name
	checkpath -f -o $command_user:$command_user \
		/var/lib/hledger/.hledger.journal
}
