#!/sbin/openrc-run

name="Unifi Controller"
supervisor=supervise-daemon
command=/usr/bin/java
command_args="-jar lib/ace.jar start ${OPTS}"
: ${command_user="unifi"}
pidfile=/run/unifi/${RC_SVCNAME}.pid
command_background=yes
supervise_daemon_args="--chdir /usr/lib/unifi \
	--stdout /var/log/unifi/${RC_SVCNAME}.log \
	--stderr /var/log/unifi/${RC_SVCNAME}.log"

start_pre() {
        checkpath --directory --owner $command_user --mode 0775 \
                /run/unifi /var/log/unifi
}
