Hello Luca,

my (now modified) `Dockerfile` is just this:

> ARG suite=sid-slim
> ARG base=library/debian:$suite
> FROM $base AS build
> ENV DEBIAN_FRONTEND=noninteractive
> RUN rm -f /etc/apt/apt.conf.d/docker-clean \
>       && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > 
> /etc/apt/apt.conf.d/keep-cache
> RUN x=/usr/bin/systemd-sysusers \
>       && dpkg-divert --local --rename --divert "$x.bin" --add "$x" \
>       && printf >"$x" '%s\n' '#!/bin/sh -x' 'ls -ld / /usr /usr/lib 
> /usr/lib/sysusers.d /usr/lib/sysusers.d/basic.conf /etc /etc/sysusers.d /run 
> /run/sysusers.d || :' 'exec strace -e t=fil    e -f "$0.bin" "$@"' \
>       && chmod +x "$x" \
>       && id \
>       && uname -a
> ENV SYSTEMD_LOG_LEVEL=debug SYSTEMD_LOG_LOCATION=true SYSTEMD_LOG_COLOR=true
> RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
>       --mount=type=cache,target=/var/lib/apt,sharing=locked \
>       apt-get -qq update \
>       && apt-get -q --assume-yes install --no-install-recommends strace \
>       && apt-get -q --assume-yes install --no-install-recommends \
>               build-essential \
>               ca-certificates \
>               git \
>               openssh-client \
>               systemd-standalone-sysusers

For reference the base image is 
library/debian:sid-slim@sha256:79f776bfe715648269ab38476c7962ea2ccae5d5576b23a34613515ba7273d29

Adding the SYSTEMD_LOG_… settings finally made the problem visible:

…
> Adding 'local diversion of /usr/bin/systemd-sysusers to 
> /usr/bin/systemd-sysusers.bin'
> uid=0(root) gid=0(root) groups=0(root)
> Linux buildkitsandbox 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 
> UTC 2025 x86_64 GNU/Linux
…
> Setting up systemd-standalone-sysusers (260.1-1) ...
> + ls -ld / /usr /usr/lib /usr/lib/sysusers.d /usr/lib/sysusers.d/basic.conf 
> /etc /etc/sysusers.d /run /run/sysusers.d
> ls: cannot access '/etc/sysusers.d': No such file or directory
> ls: cannot access '/run/sysusers.d': No such file or directory
> drwxr-xr-x 1 root root 4096 Apr 14 15:16 /
> drwxr-xr-x 1 root root 4096 Apr 14 15:16 /etc
> drwxr-xr-x 3 root root 4096 Apr  6 00:00 /run
> drwxr-xr-x 1 root root 4096 Apr  6 00:00 /usr
> drwxr-xr-x 1 root root 4096 Apr 14 15:16 /usr/lib
> drwxr-xr-x 2 root root 4096 Apr 14 15:16 /usr/lib/sysusers.d
> -rw-r--r-- 1 root root 1703 Mar 23 13:27 /usr/lib/sysusers.d/basic.conf
> + :
> + exec strace -f /usr/bin/systemd-sysusers.bin basic.conf
> execve("/usr/bin/systemd-sysusers.bin", ["/usr/bin/systemd-sysusers.bin", 
> "basic.conf"], 0x7ffcad393e70 /* 18 vars */) = 0
…
> openat(AT_FDCWD, "/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 4
> statx(4, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, 
> STATX_TYPE|STATX_INO|STATX_MNT_ID, {stx_mask=STATX_ALL, stx_attributes=0, 
> stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
> writev(2, [{iov_base="src/basic/stat-util.c:380: ", iov_len=27}, 
> {iov_base="", iov_len=0}, {iov_base="statx() does not support 'STATX_"..., 
> iov_len=72}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 5) = 100
src/basic/stat-util.c:380: statx() does not support 'STATX_MNT_ID' mask 
(running on an old kernel?)
> close(4)                                = 0
…
> writev(2, [{iov_base="src/basic/conf-files.c:976: ", iov_len=28}, 
> {iov_base="", iov_len=0}, {iov_base="Failed to read 'basic.conf': No "..., 
> iov_len=54}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 5) = 83
src/basic/conf-files.c:976: Failed to read 'basic.conf': No such file or 
directory

Without the SYSTEMD_LOG_… settings the error message is not visible on
STDERR and `systemd-sysusers basic.conf` fails with that *wrong* error
message, which makes the underlying problem hard to identify.


Good for you this is already mention in the NEW file:

> * The Linux kernel version requirements have been updated too:
>   baseline 5.4 → 5.10, recommended baseline 5.7 → 5.14, 6.6 for full
>   functionality. Code for compatibility with versions older than the
>   baseline has been removed.


Background: I'm building a Docker image with latest `cppcheck` from
Debian Sid using a GitLab pipeline. I have no control over the docker
host which is used to build the image, so I cannot control the kernel
version. Obviously it's some very old 5.4.0-216-generic #236-Ubuntu
focal (20.04) :-( I'll ask our IT department if an update is possible.


Maybe `systemd` could print a better error message in that case hinting
at the too old kernel version instead of starting a hunt for a missing
`base.conf` 🤔

Thank you for your work
Philipp
-- 
  / /  (_)__  __ ____  __ Philipp Hahn 🐓
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ [email protected]

Reply via email to