mtylerb
Posts: 7
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

[SOLVED] DHCP Server Issues

Sat Apr 07, 2018 3:28 am

Hey folks,

I'm new to RPi. I've setup my RPi 3 B+ as a DNS/DHCP/Web/File/Printer server. It works great. What I'm a little confused by is that I'm getting errors when restarting the DHCP server. It almost looks like it's trying to start twice, claiming that it's already running. Or at least that's how I'm reading it. I'm no Linux expert, by any means, but I'm making a push right now to try and change how things work in the house. So, here's the output from a couple commands:

Code: Select all

[email protected]:~ $ sudo service isc-dhcp-server stop


[email protected]:~ $ sudo service isc-dhcp-server start


Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.


[email protected]:~ $ sudo journalctl -xe

Apr 06 21:06:25 raspberrypi sudo[27415]: pam_unix(sudo:session): session opened for user root by (uid=0)

Apr 06 21:06:25 raspberrypi systemd[1]: Starting LSB: DHCP server...
-- Subject: Unit isc-dhcp-server.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit isc-dhcp-server.service has begun starting up.

Apr 06 21:06:25 raspberrypi isc-dhcp-server[27445]: Launching IPv4 server only.

Apr 06 21:06:26 raspberrypi isc-dhcp-server[27445]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1

Apr 06 21:06:26 raspberrypi systemd[1]: Failed to start LSB: DHCP server.
-- Subject: Unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit isc-dhcp-server.service has failed.
-- 
-- The result is failed.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Unit entered failed state.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.

Apr 06 21:06:26 raspberrypi sudo[27415]: pam_unix(sudo:session): session closed for user root

Apr 06 21:06:28 raspberrypi sudo[27460]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe

Apr 06 21:06:28 raspberrypi sudo[27460]: pam_unix(sudo:session): session opened for user root by (uid=0)


[email protected]:~ $ sudo systemctl status isc-dhcp-server

● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-04-06 21:06:26 MDT; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 27445 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/isc-dhcp-server.service
           └─653 /usr/sbin/dhcpd -4 -q -cf /etc/dhcp/dhcpd.conf eth0


Apr 06 21:06:25 raspberrypi systemd[1]: Starting LSB: DHCP server...

Apr 06 21:06:25 raspberrypi isc-dhcp-server[27445]: Launching IPv4 server only.

Apr 06 21:06:26 raspberrypi isc-dhcp-server[27445]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.pid currenty exists) ... failed!

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Apr 06 21:06:26 raspberrypi systemd[1]: Failed to start LSB: DHCP server.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Unit entered failed state.

Apr 06 21:06:26 raspberrypi systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.


[email protected]:~ $ 
Any ideas? The server itself works great, it's distributing addresses like it's supposed to, but I'm just trying to clear up this last error. I have no idea where to look to see if it's running the command to start twice.

Thanks for the help.

Tyler
Last edited by mtylerb on Sat Apr 14, 2018 2:39 am, edited 1 time in total.

mtylerb
Posts: 7
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

Re: DHCP Server Issues

Sun Apr 08, 2018 7:21 pm

If I'm posting this in the wrong spot, could someone let me know?

mtylerb
Posts: 7
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

Re: DHCP Server Issues

Fri Apr 13, 2018 9:35 pm

Nobody has any ideas?

mtylerb
Posts: 7
Joined: Sat Apr 07, 2018 3:14 am
Location: Warburg, AB, Canada

Re: DHCP Server Issues

Fri Apr 13, 2018 11:10 pm

Alright, so after doing some digging, and some invaluable help from a friend that has way more experience with Linux than I, there were a couple issues...

Code: Select all

$ps auxww|grep dhcp
Showed me 3 processes running, one was the dhcpcd client, which wasn't even needed, so I killed that and removed it from my boot up list. Another showed dhcpd running, but I wasn't able to affect it with service or systemctl commands. So ran a kill on the affected pid. #3 was just the grep command being run, so that was a non-issue.

Next problem was IPv6. I don't have IPv6 at my house yet, so I didn't fill in the configuration file. However, it was still trying to listen and was inevitably failing. I commented out the 3 lines in /etc/default/isc-dhcp-server6.

Third issue was there was a pid file for dhcpd in /run. So after verifying that isc-dhcp-server was stopped, and seeing as the processes in step 1 we did just that, I ran

Code: Select all

$sudo rm /run/dhcpd.pid
.

After doing these, running

Code: Select all

$sudo service isc-dhcp-server start
started without issue.

Hopefully this helps someone in the future.

Gaius Baltar
Posts: 1
Joined: Thu Jun 14, 2018 6:16 am
Location: Paris, France

Re: [SOLVED] DHCP Server Issues

Thu Jun 14, 2018 6:29 am

Hi Mtylerb!

"Hopefully this helps someone in the future"

It did! Your post really helped me today. I had the same kind of issue today and thanks to you, I understood that my problem was related to IPV6.

I have it disabled at home. After some research and reading your post, I looked to /etc/default/isc-dhcp-server and commented the last line.

Code: Select all

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

So I registered because I have to say "thank you!".

Return to “Raspbian”