#!/sbin/openrc-run

command=/usr/bin/lsyncd
pidfile=/var/run/lsyncd/${SVCNAME}.pid
conf=/etc/lsyncd/${SVCNAME}.lua

: ${exec_user:=root}
: ${exec_group:=root}

start_stop_daemon_args="--user $exec_user --group $exec_group --chdir /etc/lsyncd"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath --directory ${pidfile%/*} --owner ${exec_user}:${exec_group}
	command_args="$conf -pidfile $pidfile $command_args"
}
