Skip to content

Commit

Permalink
--init=systemd: cgroupv2 message for podman+crun #349
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 9, 2022
1 parent 30fd58d commit 5437385
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions x11docker
Expand Up @@ -11,7 +11,7 @@
# Run 'x11docker --help' or scroll down to read usage information.
# More documentation at: https://github.com/mviereck/x11docker

Version="7.1.0-beta-8"
Version="7.1.0-beta-9"

# --enforce-i: Enforce running in interactive mode to allow commands tty and weston-launch in special setups.
grep -q -- "--enforce-i" <<< "$*" && case $- in
Expand Down Expand Up @@ -4491,11 +4491,18 @@ check_cgroup() { # check [and create] cgroup mountpoint for syste

case "$Initsystem" in
systemd)
grep -q cgroup2 /proc/filesystems && note "Option --init=systemd: Found cgroup v2
grep -q cgroup2 /proc/filesystems && {
debugnote"Option --init=systemd: cgroup v2 detected."
[ "$Backend" = "podman" ] && [ "$Runtime" = "crun" ] || {
note "Option --init=systemd: Found cgroup v2
on your system. systemd in container might fail without an error message.
Currently only '--backend=podman --runtime=crun' is known to work
in a pure cgroup v2 setup without hybrid support.
As a workaround you can set a kernel boot option to enforce cgroup v1:
systemd.unified_cgroup_hierarchy=0
Compare ticket https://github.com/mviereck/x11docker/issues/349"
}
}
;;
esac

Expand Down Expand Up @@ -5028,7 +5035,7 @@ create_backendcommand() { ### create command to run docker
case "$Backend" in
docker|podman|nerdctl)
Backendcommand="$Backendcommand \\
--volume $(convertpath volume /sys/fs/cgroup /sys/fs/cgroup)"
--volume $(convertpath volume /sys/fs/cgroup:ro /sys/fs/cgroup)"
# --mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly"
;;
esac
Expand Down

0 comments on commit 5437385

Please sign in to comment.