-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
systemd does not work when host has cgroup2 #12
Comments
I've just hit this issue too. @lostiniceland did you ever find a fix / workaround? |
I haven't encountered this issue on my CI images in GitHub Actions, and verified things are working locally too... can you give an example to reproduce the issues you're seeing? |
Very possibly I'm doing something wrong, but if you can spot what I'd be very grateful! Here is a minimal example (assuming standard role structure generated with molecule.yml
converge.yml
Running
Execing into the container and running
|
@ollie1 - You're missing the command override—molecule injects a command that needs to be removed for systemd to be the first process in the container; see https://github.com/geerlingguy/ansible-role-apache/blob/master/molecule/default/molecule.yml#L9
|
Same issue
It is certainly from operating system.
|
@Vakhrushev - Did you modify your molecule config to override the command as I mentioned above? |
Yes. Do it from zero.
|
@Vakhrushev - I just did the exact same thing (
My stats:
I'll update my version of molecule to latest and see if that makes a difference. Edit: Works the same with Molecule 3.3.0. Are you using the latest HEAD on my apache repository? |
I just noticed my docker-centos7-ansible image was 7 months old so I'm updating it now... Heh... it's still that one:
I just realized I haven't updated this repository to build off GitHub Actions yet. I should probably do that. The last time it was built was 7 months ago, back when Travis CI still worked. |
@geerlingguy Thank you so much - adding the command fixed it. Now it all works as expected. |
My trouble with systemd 248 Downgrade to systemd 247. work for me |
@Vakhrushev did you downgrade on the Docker host or in the image? |
@lostiniceland downgrade systemd on host. |
Can anyone try pulling the latest version of this image (once it builds and pushes... should happen soon after #14 was merged). |
I've pulled the new image and used it for doing some postgresql testing via molecule with systemd and not noticed a problem. The new ansible version does show up too. |
Just noticed this problem this morning on my windows machine (ubuntu 20.04 wsl2) while I had no issues before.
The same configuration / code base works fine on Centos 7 vmware host.
|
I wonder if this is a cgroup v1/v2 issue... Here's a relevant issue from podman, it might be a similar case with docker: Maybe this is something those with problems can cross-check in their environments. It that is indeed the issue, then it seems we can't do much about it, except use a different container host that (also) supports cgroups v1. |
I hit this and eventually found docker/for-mac#6073 Issue is cgroups v1 vs v2. At time of comment, there are experimental builds to allow choice of cgroup version. |
Ah... that'd explain it. For some reason I'm still on 4.1.1. |
Here is a script to use deprecatedCgroupv1 in Docker Desktop for Mac (4.6.0 at time of writing): This fixes Failed to connect to bus: No such file or directory in Molecule tests on macOS that were working in older versions of Docker Desktop for Mac. |
@lostiniceland @geerlingguy would it be okay to change the title to systemd does not work when host has cgroup2? |
Change to |
Is there a way to add this to |
Never tried Podman inside Docker driver:
name: podman
platforms:
- name: podman-in-docker
# ... other options
cgroup_manager: cgroupfs
storage_opt: overlay.mount_program=/usr/bin/fuse-overlayfs
storage_driver: overlay |
Currently any systemd operation fails on this image.
The issue is probably linked to this one
ansible/ansible#71528
There seems to be some changes on systemd-side which had some follow-up changes in Ansible, but even after updating to 2.10.4 the error persists. I can only assume that the additional modifications to make systemd work inside a container have to be adjusted...
The text was updated successfully, but these errors were encountered: