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

name="Mycorrhiza Wiki"
description="Lightweight wiki engine based on Git"

: ${mycorrhiza_opts:="/var/lib/mycorrhiza"}
: ${mycorrhiza_user:="mycorrhiza:mycorrhiza"}

command=/usr/bin/mycorrhiza
command_args="$mycorrhiza_opts"
command_user="$mycorrhiza_user"
capabilities="^cap_net_bind_service"

depend() {
        need net localmount
        after firewall
}

start_pre() {
	# Ensure that log files are owned by the daemon
	[ -n "$output_log" ] && checkpath -f "$output_log" -m 644 -o "$command_user"
	[ -n "$error_log" ] && checkpath -f "$error_log" -m 644 -o "$command_user"
}
