[Main]
Type = classic
Version = 0.1.0
Description = "unbound daemon"
User = ( root )
Depends = ( mount-rw )
Options = ( log )

[Start]
Execute = (
	# unbound in foreground (-d -d -p), matching debian/sv/unbound.
	# Pause if unbound-checkconf fails (runit disables the service).
	
	envfile -I /etc/default/unbound
	importas -sCuD "" DAEMON_OPTS DAEMON_OPTS
	
	ifelse { unbound-checkconf } {
		exec /usr/sbin/unbound ${Args} ${DAEMON_OPTS}
	}
	s6-pause
)

[Logger]
RunAs = s6log
Backup = 3
MaxSize = 2000000
Timestamp = tai
Destination = /var/log/unbound-s6

[Environment]
Args = !-d -d -p
