Skip to content

Wrap systemd version lookup errors#13272

Open
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-systemd-version-error
Open

Wrap systemd version lookup errors#13272
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-systemd-version-error

Conversation

@Haihan-Jiang
Copy link
Copy Markdown

Fixes #11877.

What

  • Preserve the underlying error returned by GetManagerProperty("Version") when reading the systemd manager version.
  • Narrow systemdVersion to the manager-property method it needs so the error path is unit-testable.
  • Add tests for wrapped lookup errors and existing version parsing forms.

Why

When systemd D-Bus version lookup failed, runsc returned only unable to get systemd version. That hides the actual D-Bus failure and makes intermittent host/load-related failures hard to diagnose. The returned error now includes and wraps the original cause.

Testing

  • gofmt
  • git diff --check
  • bazel build --nobuild //runsc/cgroup:cgroup_test

I also attempted bazel test //runsc/cgroup:cgroup_test. On this macOS checkout it could not run locally because the gVisor Bazel toolchain requires host setup not present here: first the default C++ headers were not found, and after adding the SDK libc++ include path the build required /usr/bin/x86_64-linux-gnu-gcc for the Linux vDSO genrule. Native go test ./runsc/cgroup is also not usable in this repo because generated packages such as pkg/refs are Bazel-managed.

@Haihan-Jiang Haihan-Jiang marked this pull request as ready for review May 24, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'unable to get systemd version' when using systemd cgroup driver

1 participant