-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for Failed to open system bus: No such file or directory
#14
Comments
Thank you! That is already further than I got when I last checked |
This is my current understanding of how this all works (or does not work). I might be incorrect on some points, but I do have a solution at the end. Bind mounting There are a few options here.
If we create a wrapper #!/bin/bash
exec /usr/bin/systemd-nspawn --keep-unit "$@" I've done my testing in podman, but this should all equally apply to docker. My setup can be seen at https://gist.github.com/techmunk/26e75c44745baf343b6c1d5b8e3c1576 start.sh kicks it all off. systemd-nspawn, and build are in a directory called |
This devtools issue from 2017 is relevant. Took me a while to find the issue again. https://bugs.archlinux.org/task/55082 |
This issue is what led me to bind-mount I think your second point (boot the container with Systemd instead of just run a process inside) is the most clean approach. I'm still trying to figure out the Buildbot configuration in #15 but my setup with 3 "booted" systemd-nspawn, Arch Linux containers shows no issues regarding Cgroups. Regarding you thinking that this approach is on the heavy side I'm not entirely sure what you mean by that but then again using Docker is on the heavy side as well compared to just building systemd-nspawn containers. (And I get a PostgresQL 16 container instead of the old PostgresQL 9.6 Debian container that currently is used.) |
The OP still had issues when using the host bus bind mount and suggested the fix might be as simple as adding the --keep-unit argument, which does in fact seem to work. I'll accept that issue was fixing a different error that does now seem to be resolved. I feel systemd is heavy for a container, as in general, a full init system is not really designed to run inside a container, and if there's a clean way to get it to work without it, I think that would be preferable, both from a maintenance, and resource usage perspective. My opinion of course. In playing around with this repo, I was unable to get it to work correctly. When the worker would start, my host would be hosed (because of systemd being run inside it), and I'd have to reboot to get back control (Might be another way, did not look into it). I suspect this is because of how the container in docker shares certain cgroup/bus resources with the host. Either way, I tried tricks I had used in the past, such as setting the I've made a pull request at #16 which at least on my system runs a build to completion. If running a full systemd init is desired, then a different approach would have to be taken. |
As the build environment is working again I'll close this one. |
Again for archzfs/archzfs/issues/521.
As described in this Arch Linux Bug Tracker Thread one workaround is to bind-mount
/run/dbus/system_bus_socket
into the container.In order to do that the
worker
definition insidedocker-compose.yml
needs to be extended to includeThis gets clear of the
Failed to open system bus: No such file or directory
message but brings up a new one:Searching the net provides several hits of various age:
FFY00/build-arch-package#8
systemd/systemd#14247
moby/moby#44402
https://serverfault.com/questions/1053187/systemd-fails-to-run-in-a-docker-container-when-using-cgroupv2-cgroupns-priva
If I configure Docker to use User Namespaces and Remapping yet a different error occurs…
I'll try to continue tomorrow…
The text was updated successfully, but these errors were encountered: