[ Wolfgang Schweer, 2020-09-28 ]
> while working on Debian Edu Bullseye, I noticed that the DHCP service 
> stopped working after upgrading the system.

[..]
 
> Reason seems to be that the init script timed out, maybe 
> /etc/default/isc-dhcp-server could not be sourced:

This isn't the case; it seems that testing the configurations is the 
cause.
 
> root@tjener:~# service isc-dhcp-server status
> * isc-dhcp-server.service - LSB: DHCP server
>      Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
>      Active: activating (start) since Mon 2020-09-28 18:24:25 CEST; 2min 36s 
> ago
>        Docs: man:systemd-sysv-generator(8)
> Cntrl PID: 1280 (isc-dhcp-server)
>       Tasks: 8 (limit: 4671)
>      Memory: 17.6M
>      CGroup: /system.slice/isc-dhcp-server.service
>              |-1280 /bin/sh /etc/init.d/isc-dhcp-server start
>              `-1310 /usr/sbin/dhcpd -t -4 -q -cf /etc/dhcp/dhcpd.conf
> 
> Sep 28 18:24:25 tjener.intern systemd[1]: Starting LSB: DHCP server...
> Sep 28 18:24:26 tjener.intern isc-dhcp-server[1280]: Launching IPv4 server 
> only.

I've found two ways to work around this issue:

(1) Commenting the related code in /etc/init.d/isc-dhcp-server

test_config()
{
        VERSION="$1"
        CONF="$2"

        #if ! /usr/sbin/dhcpd -t $VERSION -q -cf "$CONF" > /dev/null 2>&1; then
        #       echo "dhcpd self-test failed. Please fix $CONF."
        #       echo "The error was: "
        #       /usr/sbin/dhcpd -t $VERSION -cf "$CONF"
        #       exit 1
        #fi
}

and adjusting related lines in /etc/default/isc-dhcp-server (for a 
Debian Edu combined server with two network interfaces as an example):

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth0 eth1"
#INTERFACESv6=""

----------------------

(2) Use a systemd unit file /etc/systemd/system/isc-dhcp-server.service

[Unit]
Description=DHCP server
After=network.target network-online.target
Requires=slapd.service

[Service]
Type=forking
RestartSec=2s
Restart=on-failure
ExecStartPre=-/usr/bin/touch /var/lib/dhcp/dhcpd.leases
ExecStart=/usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf

[Install]
WantedBy=multi-user.target

---------------------

Please note that I'm no expert, I guess the unit file could be improved.

Wolfgang

Attachment: signature.asc
Description: PGP signature

Reply via email to