#!/sbin/openrc-run

description="System and kernel logging daemon"
extra_started_commands="reload rotate"

command="/usr/sbin/syslogd"
command_args="${SYSLOGD_OPTS:--8 -m 0}"
pidfile="/run/syslogd.pid"
required_files="/etc/syslog.conf"
start_stop_daemon_args="-g adm -k 027"

description_reload="Reload configuration and reopen log files"
description_rotate="Rotate configured log files"

depend() {
	need clock hostname localmount
	before net
	provide logger
}

reload() {
	ebegin "Reloading sysklogd configuration"
	start-stop-daemon --signal HUP --pidfile "$pidfile"
	eend $?
}

rotate() {
	ebegin "Rotating sysklogd log files"
	start-stop-daemon --signal USR2 --pidfile "$pidfile"
	eend $?
}
