systemd 262: systemd-coredumpd.service ends up failed (start-limit-hit) on kernels older than 6.19 instead of falling back cleanly
systemd version the issue has been seen with
262
Used distribution
OpenEmbedded-Core / Yocto (poky), master. Reproduced with systemd 262 built from the v262 tag.
Linux kernel version used
6.18.52 (uname -r: 6.18.52-yocto-standard)
CPU architectures issue was seen on
x86_64
Component
systemd-coredump
Expected behaviour you didn't see
On a kernel that does not support the flags checked by
systemd-coredump --check-requirements, systemd-coredumpd.service should be
skipped cleanly and the system should keep using the per-coredump
[email protected] path, as described in the NEWS entry for 262
("Older kernels continue to use the per-coredump [email protected]
path.").
A single condition check does behave that way (clean skip). The problem is that under repeated activation it does not stay skipped.
Unexpected behaviour you saw
systemd-coredumpd.service is enabled by default via presets/90-systemd.preset (added in 9c665ee7aa). On a kernel older than 6.19 its ExecCondition (systemd-coredump --check-requirements) fails, because coredump_manager_check_requirements() requires PIDFD_INFO_COREDUMP | PIDFD_INFO_COREDUMP_SIGNAL and PIDFD_INFO_COREDUMP_SIGNAL is only available since Linux 6.19.
A single start results in a clean "skipped due to exec-condition". But the unit has:
Upholds=systemd-coredump-register.service
Restart=on-failure
RestartSec=0so repeated activation makes the repeated start attempts exhaust the start limit and the unit ends up:
Active: failed (Result: start-limit-hit)i.e. the "graceful fallback" for older kernels is not graceful — the unit is left in a failed state. (kernel.core_pattern still points at the per-coredump handler, so coredumps themselves keep working; the visible impact is a spuriously failed unit.)
I reproduced the failed state by activating the unit a few times by hand (see
below). It was also seen on the Yocto autobuilder during a normal full-image
test run, where OpenEmbedded's test_systemd_failed (which asserts
systemctl --failed is empty) failed on it:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/95/builds/4667
On that run the start-limit-hit happened during the test window (not at early
boot); I haven't confirmed what re-activates the unit there. On a quiet boot a
single condition check just skips cleanly.
Steps to reproduce the problem
- Boot a systemd 262 system with systemd-coredumpd.service preset-enabled on a kernel older than 6.19 (tested: Linux 6.18.52).
- Trigger the unit repeatedly (simulating Upholds= / socket re-activation under load), e.g.: for i in $(seq 1 8); do systemctl start systemd-coredumpd.service; done
- Check: systemctl status systemd-coredumpd.service
Additional program output to the terminal or log subsystem illustrating the issue
# uname -r
6.18.52-yocto-standard
# systemctl --version | head -1
systemd 262 (262)
# the requirement check genuinely fails at runtime on this kernel
# (the flag is defined in the userspace UAPI header, so this is a runtime
# kernel-capability gap, not a build issue):
# SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-coredump --check-requirements
ioctl(PIDFD_GET_INFO) does not support PIDFD_INFO_COREDUMP and/or PIDFD_INFO_COREDUMP_SIGNAL.
# echo $?
1
# single boot: clean skip (as expected)
systemd[1]: systemd-coredumpd.service: Skipped due to 'exec-condition'.
systemd[1]: Condition check resulted in Listen Kernel Core Dump Socket being skipped.
# after repeated activation: start-limit-hit
# for i in $(seq 1 8); do systemctl start systemd-coredumpd.service; done
# systemctl status systemd-coredumpd.service
x systemd-coredumpd.service - Listen Kernel Core Dump Socket
Loaded: loaded (...; enabled; preset: enabled)
Active: failed (Result: start-limit-hit)
tttttrocess: ExecCondition=/usr/lib/systemd/systemd-coredump --check-requirements (code=exited, status=1/FAILURE)
systemd[1]: Condition check resulted in Listen Kernel Core Dump Socket being skipped.
systemd[1]: systemd-coredumpd.service: Start request repeated too quickly.
systemd[1]: systemd-coredumpd.service: Failed with result 'start-limit-hit'.
# core_pattern remains the per-coredump fallback (coredumps still work)
# cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %d %F %Iaq
--- Suggested fix (optional) ---
Make the condition-unmet case not escalate to a failed state, e.g. drop
Restart=on-failure (or set StartLimitIntervalSec=0) so a failing ExecCondition
stays a clean skip, and/or gate the unit with a ConditionKernelVersion= so it is
skipped on unsupported kernels.
Also, it may help to document that the manager needs PIDFD_INFO_COREDUMP_SIGNAL
(Linux 6.19) specifically — the NEWS text is accurate that the socket protocol
exists since 6.17 and only enables coredumpd "on supported kernels", but
"supported" (>= 6.19) is not defined anywhere, which makes >= 6.17 look
sufficient.Source: systemd/systemd