Package: dhcpcd-base
Version: 1:10.5.2-5
Severity: important
Tags: upstream patch
Forwarded: https://github.com/NetworkConfiguration/dhcpcd/issues/716
Dear Maintainer,
dhcpcd 10.5.2 no longer points stdout/stderr at /dev/null when it
daemonises. Any caller that reads dhcpcd's output through a pipe
therefore hangs forever, even though the lease is applied. 10.3.2 is
not affected.
Reproducer:
dhcpcd --ipv4only --waitip --persistent --noarp eth0 | cat
With 10.5.2 this never returns, and /proc/<pid>/fd/{1,2} of the daemon
still point to the pipe.
Cause: upstream commit 62018896 made setrlimit(RLIMIT_NOFILE, {0,0}) in
ps_dropprivs() unconditional. On Linux, dup2() onto fds 1/2 then fails
with EBADF, and dhcpcd_daemonised() ignores the error.
Known affected callers:
- cloud-init ephemeral DHCP: waits until its 300s timeout, slowing
boot (upstream #737)
- netplan.io autopkgtest "wifi" (subprocess.check_output on
dhcpcd -w), which now hangs until the timeout in Ubuntu:
https://autopkgtest.ubuntu.com/packages/n/netplan.io/stonking/amd64
- sysvinit setups where rc scripts wait on the console (upstream #716)
Upstream fix (open PR, not merged yet):
https://github.com/NetworkConfiguration/dhcpcd/pull/733
Please consider applying it as a patch until the next upstream release.