Dear Maintainer,
After a reboot I found isc-dhcp-server wasn't running because dhcpd
was started before named wrote out session.key (included for ddns).
I have ddns enabled with the following included in
/etc/dhcp/dhcpd.conf
include "/var/run/named/session.key";
I see /etc/init.d/isc-dhcp-server has $named listed in Should-Start,
but apparently that's not sufficient with systemd, I expect dhcpd
takes less time to start compared with the multiple domains named is
serving on the system.
# Should-Start: $local_fs slapd $named
I added the following loop to the default file, I'm not sure the best
way to properly handle this.
/etc/default/isc-dhcp-server
# delay watching for the session.key file to appear from named for ddns
include="/var/run/named/session.key"
i=0
while [ "$1" = "start" -a $i -lt 30 -a ! -e "$include" ] ; do
echo "waiting on $include"
i=$(($i+1))
sleep 1
done
unset include i
Here are the relevant parts of the system log file showing dhcpd
not finding session.key, then a second later named starts.
Oct 31 08:17:24 localhost dhcpd[1933]: Internet Systems Consortium DHCP Server 4.3.5
Oct 31 08:17:24 localhost dhcpd[1933]: Can't open /var/run/named/session.key: No such file or directory
Oct 31 08:17:24 localhost dhcpd[1933]: exiting.
Oct 31 08:17:24 localhost systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Oct 31 08:17:24 localhost systemd[1]: Failed to start LSB: DHCP server.
Oct 31 08:17:24 localhost systemd[1]: isc-dhcp-server.service: Unit entered failed state.
Oct 31 08:17:24 localhost sh[1883]: Restarting isc-dhcp-server (via systemctl): isc-dhcp-server.serviceJob for isc-dhcp-server.service failed because the control process exited with error code.
Oct 31 08:17:24 localhost sh[1883]: See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
Oct 31 08:17:24 localhost systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Oct 31 08:17:25 localhost named[2048]: starting BIND 9.10.3-P4-Debian <id:ebd72b3> -f -u bind
Oct 31 08:17:25 localhost named[2048]: loading configuration from '/etc/bind/named.conf'
Oct 31 08:17:26 localhost named[2048]: running