#!/usr/bin/execlineb -P

# socket-dir ist ohne Konfiguration /var/run/pdns, und niemand legt das an:
# fuer pdns gibt es kein tmpfiles-Schnipsel, Debians systemd-Unit erledigt es
# ueber RuntimeDirectory=pdns. Unter s6 legt es die Unit selbst an, wie
# bind9-s6 fuer /run/named. pdns:pdns, damit es auch mit setuid=pdns in der
# Konfiguration passt (Debians Unit laeuft als User pdns).
if { install -d -m 0755 -o pdns -g pdns /run/pdns }

# Bereitschaft ist nicht "Prozess laeuft": pdns oeffnet den Controlsocket und
# die Backends erst nach dem Start, und mit kaputter Backend-Konfiguration
# stirbt es danach. data/check fragt den Dienst selbst.
s6-notifyoncheck -d -n30 --
run-script-daemon pdns
