You are not logged in.

#1 2021-01-26 17:06:15

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

[Solved] DHCPD doesn't start

Okay I have a simple dhcpd server from the dhcp packet with the following config.

/etc/dhcpd.conf
# Me:
option domain-name-servers 1.1.1.1, 8.8.8.8;
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;

subnet 192.168.1.0 netmask 255.255.255.0 {

	# give it a range of 16 members
	range 192.168.1.16 192.168.1.32;	
}

But It won't start:

# systemctl status dhcpd4
● dhcpd4.service - IPv4 DHCP server
     Loaded: loaded (/usr/lib/systemd/system/dhcpd4.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2021-01-26 18:04:53 CET; 14s ago
    Process: 17068 ExecStart=/usr/bin/dhcpd -4 -q -cf /etc/dhcpd.conf -pf /run/dhcpd4/dhcpd.pid (code=exited, status=1/FAILURE)

Jan 26 18:04:53 arch systemd[1]: dhcpd4.service: Scheduled restart job, restart counter is at 5.
Jan 26 18:04:53 arch systemd[1]: Stopped IPv4 DHCP server.
Jan 26 18:04:53 arch systemd[1]: dhcpd4.service: Start request repeated too quickly.
Jan 26 18:04:53 arch systemd[1]: dhcpd4.service: Failed with result 'exit-code'.
Jan 26 18:04:53 arch systemd[1]: Failed to start IPv4 DHCP server.

Does anybody have an idea why the server doesn't start?

Last edited by Stefan_xyz (2021-02-14 13:42:45)

Offline

#2 2021-01-26 17:33:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [Solved] DHCPD doesn't start

Check the journal for output from the dhcpd process - or better yet, try running it manually so you can see the output.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-01-26 19:28:06

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Trilby wrote:

Check the journal for output from the dhcpd process - or better yet, try running it manually so you can see the output.

The manual output is literally nothing.

Offline

#4 2021-01-26 20:16:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [Solved] DHCPD doesn't start

Did you remove the '-q' flag?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2021-01-27 12:27:58

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Trilby wrote:

Did you remove the '-q' flag?

No after doing it I get the following output:

Internet Systems Consortium DHCP Server 4.4.2
Copyright 2004-2020 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Config file: /etc/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /run/dhcpd4/dhcpd.pid
Source compiled to use binary-leases
Wrote 2 leases to leases file.
[...]

Listening on LPF/enp3s0f1/80:fa:5b:57:bd:d2/192.168.1.0/24
Sending on   LPF/enp3s0f1/80:fa:5b:57:bd:d2/192.168.1.0/24
Sending on   Socket/fallback/fallback-net
Can't create PID file /run/dhcpd4/dhcpd.pid: No such file or directory.

So how can I fix this error?

Offline

#6 2021-01-27 14:38:57

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [Solved] DHCPD doesn't start

Did you ru dhcpcd as root?

Offline

#7 2021-01-27 22:17:11

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

seth wrote:

Did you ru dhcpcd as root?

yes

Offline

#8 2021-01-27 22:21:57

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [Solved] DHCPD doesn't start

If you create the dir, does it work?

Offline

#9 2021-01-29 20:27:02

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Scimmia wrote:

If you create the dir, does it work?

Can't create a file in the

 /run/ 

directory.

Offline

#10 2021-01-29 20:28:39

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [Solved] DHCPD doesn't start

Why not?

Offline

#11 2021-02-02 17:51:30

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Scimmia wrote:

Why not?

root@arch ~ # touch /run/dhcpd4/dhcpd.pid
touch: cannot touch '/run/dhcpd4/dhcpd.pid': No such file or directory

I assume run is a write protected environment.

Offline

#12 2021-02-02 18:35:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [Solved] DHCPD doesn't start

I said to create the dir, not the file.

Offline

#13 2021-02-14 13:42:31

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Scimmia wrote:

I said to create the dir, not the file.

Sorry for the late reply but yes this fixed it. Thanks!

Offline

#14 2021-02-14 13:46:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: [Solved] DHCPD doesn't start

That works around it, it doesn't fix it. changes would need to be made to the systemd-tmpfiles entry or the service file to really fix it. A bug report would be appropriate here.

Offline

#15 2021-02-14 13:56:43

Stefan_xyz
Member
Registered: 2019-09-01
Posts: 104

Re: [Solved] DHCPD doesn't start

Scimmia wrote:

That works around it, it doesn't fix it. changes would need to be made to the systemd-tmpfiles entry or the service file to really fix it. A bug report would be appropriate here.

Thanks for the information I will write one.

Offline

Board footer

Powered by FluxBB