[systemd-devel] Debugging systemd in a container
Mark Clarkson
mark.clarkson at smorg.co.uk
Sun May 10 00:28:55 UTC 2020
Hi!
I have been writing a tool that creates kubernetes clusters in
containers. I had just about finished when I upgraded to Fedora 32
yesterday and it dropped docker and moved to cgroupv2.
So, I have Podman and Cgroupv2 now.
Using a centos 7 container with systemd, I cannot get systemd to start.
The container starts and /usr/sbin/init is running, but no dbus, or
systemd - only init.
For the container a script starts and sets machine ID, product name,
product uuid, mounts /sys /dev etc. It all worked with cgroupv1, but
now with the new cgroupv2, it doesn't.
I have been trying to debug this but I can't get any logs out of
systemd.
I can add cmdline options to systemd. I currently have the following in
the Dockerfile:
ENTRYPOINT ["/usr/local/bin/entrypoint", "/usr/sbin/init",
"systemd.unified_cgroup_hierarchy", "debug"]
I also start the container with:
podman run -d \
-v /sys/fs/cgroup:/sys/fs/cgroup:ro \
--privileged \
--tmpfs /run \
-e container=docker \
--tmpfs /tmp \
c7-systemd
I would really like to get some information out of systemd to work
through the errors, but I can't work out how to do it. I expected it to
output to stdout and be accessible through 'podman logs <ID>'.
This was another line I tried:
ENTRYPOINT ["/usr/local/bin/entrypoint", "/usr/sbin/init",
"systemd.showstatus", "systemd.default_standard_output=tty",
"systemd.unified_cgroup_hierarchy", "debug"]
Can anyone point me in the right direction? Of course, 'journalctl -xe'
says:
No journal files were found.
-- No entries --
I need logs!! :)
Thanks!
Mark
More information about the systemd-devel
mailing list