#868240 isc-dhcp-server refuses to start if pidfile is present even when dhcpd is not running #868240
- Package:
- isc-dhcp-server
- Source:
- isc-dhcp
- Description:
- ISC DHCP server for automatic IP address assignment
- Submitter:
- Samuli Seppänen
- Date:
- 2026-08-05 17:34:11 UTC
- Severity:
- normal
Dear Maintainer,
The isc-dhcp-server service refuses to start ("systemctl start isc-dhcp-server")
if the pidfile (/run/dhcpd.pid) is present, even if dhcpd is
not running. Reproducing this is easy given working dhcpd configuration:
$ systemctl start isc-dhcp-server
$ cat /run/dhcpd.pid|xargs kill
$ systemctl start isc-dhcp-server
Now dhcpd will not be running:
$ ps aux|grep dhcpd
This is problematic if the service has crashed abnormally, as external
monitoring systems like monit won't be able to restart the service easily.
The problem is on lines 102-105 in /etc/init.d/isc-dhcp-server:
if [ -e "$PIDFILE" ]; then
log_failure_msg "dhcpd service already running (pid file $PIDFILE currenty exists)"
exit 1
fi
Interestingly the status target can already handle the "pidfile is present but
dhcpd is not running" case, see line 83:
test "$OPTION" != -v || echo "$NAME is not running but $PIDFILE exists."
Removing the pidfile manually before starting the service solves the problem.
I would expect the init script to start dhcpd if it is not running, even if
pidfile is present.
Hi, I encountered the same issue after a crash of the dhcpd process. The daemon could not be restarted without deleting the old PID file first. I modified the /etc/init.d/isc-dhcp-server script on my servers from : |if [ -e "$PIDFILE" ]; then log_failure_msg "dhcpd service already running (pid file $PIDFILE currenty exists)" exit 1 fi| To : |if [ -e "$PIDFILE" ]; then if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then log_failure_msg "dhcpd service already running (pid file $PIDFILE currenty exists)" exit 1 fi fi|
Hi, I have a setup with 2 redundant (primary / secondary) DHCPd servers where both of them crash occasionally. This is a separate bug, but this solution was useful in restarting the daemons after crashing and leaving the pid files behind. To automatically restart the daemons after this modification is introduced, edit the systemd service description with systemctl edit isc-dhcp-server.service and add something like [Service] Type=forking PIDFile=dhcpd.pid Restart=on-failure StartLimitIntervalSec=60s StartLimitBurst=8 RestartSec=5s in the appropriate section. Then enable this configuration, and systemd will be able to restart DHCPd after they crash.
Dear submitter, as the package isc-dhcp has just been removed from the Debian archive unstable we hereby close the associated bug reports. We are sorry that we couldn't deal with your issue properly. For details on the removal, please see https://bugs.debian.org/1143544 The version of this package that was in Debian prior to this removal can still be found using https://snapshot.debian.org/. Please note that the changes have been done on the master archive and will not propagate to any mirrors until the next dinstall run at the earliest. This message was generated automatically; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org. Debian distribution maintenance software pp. Thorsten Alteholz (the ftpmaster behind the curtain)