Package: isc-dhcp-server
Version: 4.3.5-3+deb9u1
Severity: normal

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



-- System Information:
Debian Release: 9.5
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15), LANGUAGE=C 
(charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages isc-dhcp-server depends on:
ii  debconf [debconf-2.0]  1.5.61
ii  debianutils            4.8.1.1
ii  libc6                  2.24-11+deb9u3
ii  libdns-export162       1:9.10.3.dfsg.P4-12.3+deb9u4
ii  libirs-export141       1:9.10.3.dfsg.P4-12.3+deb9u4
ii  libisc-export160       1:9.10.3.dfsg.P4-12.3+deb9u4
ii  lsb-base               9.20161125

Versions of packages isc-dhcp-server recommends:
ii  isc-dhcp-common  4.3.5-3+deb9u1
pn  policycoreutils  <none>

Versions of packages isc-dhcp-server suggests:
pn  isc-dhcp-server-ldap  <none>
ii  policykit-1           0.105-18

-- Configuration Files:
/etc/dhcp/dhcpd.conf changed [not included]
/etc/dhcp/dhcpd6.conf changed [not included]

-- debconf information excluded

Reply via email to