You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root@SRU-worked-azure:/home/ubuntu/dhcpcd-10.0.6# pkill -9 dhcpcd
root@SRU-worked-azure:/home/ubuntu/dhcpcd-10.0.6# dhcpcd --dumplease -4 eth0
dhcpcd is not running
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:
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.
FixesNetworkConfiguration#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.
FixesNetworkConfiguration#286
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: