#!/sbin/openrc-run

supervisor=supervise-daemon
respawn_delay=5
respawn_max=0
name=$SVCNAME
cfgfile="/etc/$SVCNAME/$SVCNAME.conf"
command="/usr/bin/$SVCNAME"
command_args="-c /etc/$SVCNAME/$SVCNAME.conf"
command_user="alpine"
pidfile="/run/$SVCNAME/$SVCNAME.pid"
command_background="yes"

depend() {
        need net
	after firewall
	use ntp-client
}

start_pre() {
	mkdir -p /var/log/$SVCNAME
	mkdir -p /var/lib/$SVCNAME

        checkpath --directory --owner $command_user:$command_user --mode 0775 /run/$SVCNAME /var/log/$SVCNAME /var/lib/$SVCNAME

}
