Switch official packages to systemd Type=notify
MR !5514 (merged) (applied only to v9.19) added support for sd_notify
interface. Our Linux packages for systems with systemd should switch to Type=notify
so the systemd can correctly report state of the service and its startup/shutdown progress.
This systemd unit works on my system:
[Service]
Type=notify
EnvironmentFile=-/usr/local/etc/named/sysconfig
#PIDFile=/usr/local/var/run/named/named.pid
ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/local/sbin/named-checkconf -z /usr/local/etc/named/named.conf; else echo "Checking of zone files is disabled"; fi'
ExecStart=/tmp/1176-add-support-for-sd_notify-interface-to-better-integrate-on-linux/sbin/named -f
Please note:
- Forking is not needed - we should use
-f
. -
PIDFile
is not needed anymore as systemd can see the first process (and the process reports its PID anyway via sd_notify()).
Caveats:
- Startup/shutdown timeouts: We need to investigate interaction between (default?)
TimeoutStartSec
andTimeoutStopSec
and large zones (or lots of zones). I'm not sure what is the current behavior, and I would not be entirely surprised if these timeouts did something stupid on systems with large zones. If it is causing problems we can either:- extend BIND to call sd_notify(..., "EXTEND_TIMEOUT_USEC=...") to let systemd know BIND keeps slogging away on a huge zone(s)
- disable timeouts