rc.dhcpd has an odd error.
by Richard Cranium from LinuxQuestions.org on (#6FZ65)
This hasn't come up because who the devil restarts their dhcpd while the system is running? (At least that's my story and I'm sticking to it.)
It turns out I've been doing that while attempting to fix a dynamic DNS issue. The issue comes about because the dhcpd binary looks for the pid file and won't start if it finds one.
For example, the first time you run restart:
Code:root@testbed:~# /etc/rc.d/rc.dhcpd restart
Shutting down dhcpd:
Starting dhcpd: /usr/sbin/dhcpd Internet Systems Consortium DHCP Server 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/state/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
There's already a DHCP server running.
If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging.
exiting.
root@testbed:~#...but the second time you run that command, you get...
Code:root@testbed:~# /etc/rc.d/rc.dhcpd restart
Shutting down dhcpd: dhcpd: no process found
Starting dhcpd: /usr/sbin/dhcpd Internet Systems Consortium DHCP Server 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/state/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 1 leases to leases file.
Listening on LPF/virbr0/52:54:00:0a:3c:64/192.168.122.0/24
Sending on LPF/virbr0/52:54:00:0a:3c:64/192.168.122.0/24
Listening on LPF/eth0/b4:2e:99:4c:f8:21/10.10.0.0/24
Sending on LPF/eth0/b4:2e:99:4c:f8:21/10.10.0.0/24
Listening on LPF/eth1/00:13:3b:0e:d0:9e/172.16.0.0/24
Sending on LPF/eth1/00:13:3b:0e:d0:9e/172.16.0.0/24
Sending on Socket/fallback/fallback-net
root@testbed:~#There are a couple of ways to fix the issue:
It turns out I've been doing that while attempting to fix a dynamic DNS issue. The issue comes about because the dhcpd binary looks for the pid file and won't start if it finds one.
For example, the first time you run restart:
Code:root@testbed:~# /etc/rc.d/rc.dhcpd restart
Shutting down dhcpd:
Starting dhcpd: /usr/sbin/dhcpd Internet Systems Consortium DHCP Server 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/state/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
There's already a DHCP server running.
If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging.
exiting.
root@testbed:~#...but the second time you run that command, you get...
Code:root@testbed:~# /etc/rc.d/rc.dhcpd restart
Shutting down dhcpd: dhcpd: no process found
Starting dhcpd: /usr/sbin/dhcpd Internet Systems Consortium DHCP Server 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/state/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 1 leases to leases file.
Listening on LPF/virbr0/52:54:00:0a:3c:64/192.168.122.0/24
Sending on LPF/virbr0/52:54:00:0a:3c:64/192.168.122.0/24
Listening on LPF/eth0/b4:2e:99:4c:f8:21/10.10.0.0/24
Sending on LPF/eth0/b4:2e:99:4c:f8:21/10.10.0.0/24
Listening on LPF/eth1/00:13:3b:0e:d0:9e/172.16.0.0/24
Sending on LPF/eth1/00:13:3b:0e:d0:9e/172.16.0.0/24
Sending on Socket/fallback/fallback-net
root@testbed:~#There are a couple of ways to fix the issue:
- You can make "--no-pid" a default DHCPD_OPTIONS value, so there won't be a pid file to check
- You can add "rm /var/run/dhcpd.pid" in the stop() block