#!/usr/bin/execlineb -P

envfile -I /etc/s6-rc/config/unbound.conf
importas -sCuD "n3 s2000000 T" DIRECTIVES DIRECTIVES

ifelse { test -w /var/log } {
	foreground { install -d -o s6log -g s6log /var/log/unbound-s6 }
	s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/unbound-s6
}
foreground { install -d -o s6log -g s6log /run/log/unbound }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /run/log/unbound
