#!/usr/bin/execlineb -P

# named starts as root and drops to the user from OPTIONS in
# /etc/default/named ("-u bind", Debian default); pid file and session key
# go to /run/named, which run-script-daemon creates for its DAEMON_USER
# (root) -- make it writable for the bind group first.
if { mkdir -p /run/named }
if { chown root:bind /run/named }
if { chmod 0775 /run/named }
# Readiness: rndc status reports "server is up and running" (data/check),
# every 1 s for up to 120 s -- large zones take time to load.
s6-notifyoncheck -d -w 1000 -n 120 --
run-script-daemon named
