#!/usr/sbin/openrc-run

description="U-Bus systemwide message bus"

command="/usr/sbin/ubusd"
command_args="-A/usr/share/acl.d"

extra_started_commands="reload"

depend() {
	need localmount
	use logger
	after rsyslog
}

start() {
	[ -x "$command" ] || return 1
	ebegin "Starting ${RC_SVCNAME}"
	start-stop-daemon -S -x "$command" -- ${command_args}
	eend $?
}

stop() {
	ebegin "Stopping ${RC_SVCNAME}"
	start-stop-daemon -K -x "$command"
	eend $?
}

reload() {
	ebegin "Reloading ubusd"
	start-stop-daemon -K -s HUP -x "$command"
	eend $?
}

status() {
	"$command" -c
}
