-
Notifications
You must be signed in to change notification settings - Fork 102
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
dhcpcd -U <interface> only works with dhcpcd daemon running #286
Comments
holmanb
added a commit
to holmanb/dhcpcd
that referenced
this issue
Jan 20, 2024
Previous code used the non-existance of data in the input buffer to determine whether to attempt parsing from stdin. When data is not immediately available in the input buffer, that logic caused the code to attempt to contact the manager daemon, which also fails. This means that `dhcpcd -U <interface>` will sometimes fail: # dhcpcd --dumplease --ipv4only < /var/lib/dhcpcd/<iface>.lease dhcpcd is not running This behavior is a race condition possibly exacerbated by slow storage media or virtualization. The following reproducer makes this behavior testable on any platform: # (sleep 0.1; sudo cat /var/lib/dhcpcd/<iface>.lease) | dhcpcd --dumplease -4 Note: Running dhcpcd -U <iface> explicitly requires a running manager daemon (see upstream issue NetworkConfiguration#286). Therefore, parsing via stdin is the only way to read leases without running the manager daemon. This is an important feature for users that get dhcp leases using --oneshot. Fixes NetworkConfiguration#286
holmanb
added a commit
to holmanb/dhcpcd
that referenced
this issue
Jan 20, 2024
Previous code used the non-existance of data in the input buffer to determine whether to attempt parsing from stdin. This is racy, so `dhcpcd -U < /path/to/lease` will sometimes fail: # dhcpcd --dumplease --ipv4only < /var/lib/dhcpcd/<iface>.lease dhcpcd is not running The fix uses the (non-)existance of an interface argument to indicate that dhcpcd should wait for data to arrive on stdin. Fixes NetworkConfiguration#286
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works as expected:
without the daemon, this surprisingly fails
Inspecting the code, it appears that if no data is read from the input buffer, the manager daemon is always contacted. This means that parsing via stdin (which is broken) is the only way to run
--dumplease
without contacting the manager daemon.The text was updated successfully, but these errors were encountered: