#1149297 dhcpcd-base: 10.5.2 hangs callers reading its output: stdout/stderr not closed when daemonising

Package:
dhcpcd-base
Source:
dhcpcd-base
Description:
DHCPv4 and DHCPv6 dual-stack client (binaries and exit hooks)
Submitter:
Sebastien Bacher
Date:
2026-09-30 05:21:02 UTC
Severity:
normal
Tags:
#1149297#5
Date:
2026-09-29 08:36:58 UTC
From:
To:
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.

#1149297#10
Date:
2026-09-30 04:50:17 UTC
From:
To:
Thanks. Please note that someone else at Canonical also submitted a MR
for an NMU on Salsa for this one. This is overkill. An NMU is not
welcome on an actively maintained package.

Martin-Éric

#1149297#15
Date:
2026-09-30 05:20:06 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
dhcpcd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1149297@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin-Éric Racine <martin-eric.racine@iki.fi> (supplier of updated dhcpcd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 30 Sep 2026 07:48:01 +0300
Source: dhcpcd
Architecture: source
Version: 1:10.5.2-6
Distribution: unstable
Urgency: medium
Maintainer: Martin-Éric Racine <martin-eric.racine@iki.fi>
Changed-By: Martin-Éric Racine <martin-eric.racine@iki.fi>
Closes: 1149297
Changes:
 dhcpcd (1:10.5.2-6) unstable; urgency=medium
 .
   * [patches]
     + 0002: Fix stdout/stderr not closed when daemonising (Closes: #1149297).
Checksums-Sha1:
 7973448384c847b383a8479124302df26bd5a9b2 2440 dhcpcd_10.5.2-6.dsc
 fd24ba8f2d2d51e80eb38ec6cc4c2452ec45c4cb 22352 dhcpcd_10.5.2-6.debian.tar.xz
 f0a1c2101e680d597f86c5bbc5a557b0cd55347c 5299 dhcpcd_10.5.2-6_source.buildinfo
Checksums-Sha256:
 664cc4e357d8ca1b21e670ea02b951b08c197adf95824ce7431b82fdd390a59e 2440 dhcpcd_10.5.2-6.dsc
 291826556b6b580a6b5c3861949dfe86c0625364084af939d542abfde25ef558 22352 dhcpcd_10.5.2-6.debian.tar.xz
 14de502977ce7c9d3ff74e0a5bea795d21647aa4a9e4f4b7d06acb9aa1b560a1 5299 dhcpcd_10.5.2-6_source.buildinfo
Files:
 5f386f03531839df60b60e57518443d3 2440 net optional dhcpcd_10.5.2-6.dsc
 6764029a120136c312790aaca31ae985 22352 net optional dhcpcd_10.5.2-6.debian.tar.xz
 2b1beea6756c0eef1e638f21b1e522a2 5299 net optional dhcpcd_10.5.2-6_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEyJACx3qL7GpObXOQrh+Cd8S017YFAmq8ldEACgkQrh+Cd8S0
17bbaA//bvhLQsRntF2TYcNnvGqIyxxS8HqEyKcTKzeG1J7z7m6uaFQnNn4cbJrW
n31p5vu1vYdBxNgc40oWiR0+qs4NVBLShV0j27BLEFyQcv6kvGE9y102bjrcnh5j
X+Urf+YFpsrGHQ4UoZiR0UN+SK8sesSoLCYCoidF+X296fN5MDJS62aBkRXE59CM
aNlWIXpUui72ckwYdi1ad+vjQ9E0B51TLDjHxsOo0IB7JkkKdxeAT5roOEt5vgRH
cnMLMq0w9YaKnmbANBvrQ4RyxfXLTBmHp3dP45jPsOkAlRwU19Rx0EVNsQ2ytnB9
nHzYqEd5nXPWopVuuCpTrEA9hXDe3XqvFkb8IzgPKQ/01ZYCgTemYo6NVPbS2UKJ
8Is2bOJMWkHUn3SmDfN5AtYvJx52T+OMqZQdDGFWVdZDH+vDt0hi+evEc/9qhc2m
r847ctRALBfpUeg/2bw40QcxppaQWD9zBcTzuMklxqCG49wPmDD65FI4V8IKVMjn
4CFFHBH/Ab9uvjCZ3/a8fkPyolzSkG9sgb5vyjxLyiEFytCqC3rtEiC9fxGdwlj+
d4CDFzBt3Q8IZK0rmgrutsPlnjeZ3g++cgjm+8iq77N/f0Dc/GSBhLkNqWuNOSVD
Zf9ddnn8+s9X6UOtEEQ/YGL6jfIkvbdPiW677uDPbgi7rb5nYzs=
=e4UL
-----END PGP SIGNATURE-----