-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHCP Server not run at first start #2304
Comments
The problem is that we cannot solve this on our own as it's not caused by us. AdGuard Home needs to be started when the network is available, and this is specified in the service configuration. The question is why in your case the order is wrong. |
@TooYoungTooSimp I guess the temporary solution would be to postpone the service startup so that the iface was actually initialized. @ainar-g this is not the first time we're facing this issue. We could implement something simple, like waiting a couple more seconds if the interface is not found on the DHCP server startup. |
I added a |
I think I'm facing the same issue. When I boot the system, the DHCP Server doesn't work properly. Devices are able to connect to the network, but hang obtaining an IP address. If I restart the service ( I'm running AdGuardHome on the following setup:
I have checked the service configuration file ( I also tried to add the instruction |
well, you should type the full path of |
Actually no, just like that was fine. I just had to increase the sleep a bit in order to make it work. Here is the service definition (/etc/systemd/system/AdGuardHome.service):
If I try to put the full path it actually fail to start. Right now, I got it booting up fine with this. My issue now is that the DHCP server stops working sometimes and I need to restart the service 😞 |
@TooYoungTooSimp, thanks for your report! Can you set
|
I can see a line likes |
@TooYoungTooSimp, thanks for the logs, they're very helpful! We need to know the IP address of the interface we're binding to, because that's the address that we send to the DHCP clients as the address of the DNS server that they should use. We're currently thinking of ways to somehow wait for the interface to get an IP. |
Merge in DNS/adguard-home from 2304-dncp-backoff to master Updates #2304. Squashed commit of the following: commit c9bff8b Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Nov 27 14:08:03 2020 +0300 dhcpd: try for 5s instead of 10s commit 983cf47 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Nov 25 19:58:41 2020 +0300 dhcpd: wait for interfaces' ip addresses to appear
Should be fixed as of snapshot 60d72fb. Can you please check if our solution fixes the issue for you? |
Merge in DNS/adguard-home from 2304-fix-panic to master Updates #2304. Squashed commit of the following: commit bd7742e Merge: 2631392 7d1d87d Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:29:37 2020 +0300 Merge branch 'master' into 2304-fix-panic commit 2631392 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:09:16 2020 +0300 all: add gitignore rule commit 5a8521b Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:03:26 2020 +0300 dhcpd: fix zero-length ip addresses list bug
I'll close this issue for now. Please feel free to reopen with more details if you think it should be reopened. |
Merge in DNS/adguard-home from 2304-dncp-backoff to master Updates #2304. Squashed commit of the following: commit c9bff8b Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Nov 27 14:08:03 2020 +0300 dhcpd: try for 5s instead of 10s commit 983cf47 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Wed Nov 25 19:58:41 2020 +0300 dhcpd: wait for interfaces' ip addresses to appear
Merge in DNS/adguard-home from 2304-fix-panic to master Updates #2304. Squashed commit of the following: commit bd7742e Merge: 2631392 7d1d87d Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:29:37 2020 +0300 Merge branch 'master' into 2304-fix-panic commit 2631392 Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:09:16 2020 +0300 all: add gitignore rule commit 5a8521b Author: Eugene Burkov <e.burkov@adguard.com> Date: Wed Dec 2 14:03:26 2020 +0300 dhcpd: fix zero-length ip addresses list bug
fix confirmed in v0.105.0-beta.1. Sorry for late response and thank for your hard work! |
I have this issue on 0.105 beta 2. running on raspberry OS 64 bits. Please let me know if you need logs to see what’s going on. |
here's the relevant parts... dhcpv4 cannot find IP address: [... bunch of leases removed ...] 2021/01/25 09:19:35 470#49 [debug] dhcpv4: added lease x.x.x.x <-> XX:XX:XX:XX:XX:XX [... bunch of clients removed ...] 2021/01/25 09:19:35 470#49 [debug] clients: added "x.x.x.x" -> "XXXXX" [13] DNS works fine. IP address is static... configured through the dhcpcd.conf file. |
FYI... adguard is installed on Raspberry OS 64 bits (which you see with arm64 on the first line of the log). |
Well, it seems something is really off with the startup order and I am not sure what we can do on our side to address this. You need to figure out why the network is not initialized by the time AGH starts up. |
I'm not sure either what could be the problem... I'm ok to leave this line as is... |
Nope, AGH does not touch it's service after the installation |
could you add an option in the config file to tell the DHCP server to wait a little bit longer... currently I believe with beta 2, it waits 5 seconds... if we could adjust this to lets say 10 seconds, it should work fine (at least for me). |
It's just there's not much difference between exposing it via the config file or changing the service file, you'll anyway need to make some changes. I guess as a temporary solution we could just increase the default limit from 5 to 10 seconds and hope that this would solve this issue for most of the users. But we're yet to figure out a better solution. @ainar-g what do you think? |
actually it's all up to systemd version https://github.com/systemd/systemd/blob/main/NEWS https://itecnotes.com/server/systemd-service-automatic-restart-after-startlimitinterval/ myself on systemd 247.3-7+rpi1+deb11u1 |
No matter what I changed in service file I got this error on boot: [error] dhcpv4: no ip for iface after 10 attempts and 5s |
Nevermind, found the missing 5 seconds, it was ARP probing: Jan 11 23:42:05 raspberrypi dhcpcd[314]: eth0: IAID eb:69:64:1a Adding noarp to interface in /etc/dhcpcd.conf fixes the problem: Jan 12 01:12:51 raspberrypi dhcpcd[314]: DUID 00:01:00:01:2a:be:6d:d5:b8:27:eb:> |
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Issue Details
Expected Behavior
dhcp listen at :67 after boot
Actual Behavior
dhcp doesn't listen 67. Unless I restart adguardhome
Screenshots
Screenshot:
Additional Information
I think maybe it's because it can not bind to specific nic at very early time.
So if there's a solution to let adguard home waiting the nic goes up to bind, it should be solved.
The text was updated successfully, but these errors were encountered: