You are not logged in.
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
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
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
Did you remove the '-q' flag?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
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
Did you ru dhcpcd as root?
Offline
Did you ru dhcpcd as root?
yes
Offline
If you create the dir, does it work?
Offline
If you create the dir, does it work?
Can't create a file in the
/run/
directory.
Offline
Why not?
Offline
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
I said to create the dir, not the file.
Offline
I said to create the dir, not the file.
Sorry for the late reply but yes this fixed it. Thanks!
Offline
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
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