File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1010import datetime
1111import io
1212import os .path
13+ import platform
1314import socket
1415import ssl
1516from collections import OrderedDict
@@ -179,6 +180,14 @@ def start(
179180 # If we are running in a systemd context, the following 3 settings are necessary to
180181 # allow services to run.
181182 if systemd_cgroup2 :
183+ # Ensure that cgroup v2 is supported before attempting to use it
184+ # Note: this check only works on linux systems
185+ if platform .system () == "Linux" and not os .path .exists (
186+ "/sys/fs/cgroup/cgroup.controllers"
187+ ):
188+ raise BuildRunnerContainerError (
189+ "cgroup v2 is not enabled on this host but is set on the container, please check configuration"
190+ )
182191 volumes ["/sys/fs/cgroup/buildrunner.scope" ] = "/sys/fs/cgroup:rw"
183192 tmpfs ["/run" ] = ""
184193 cgroupns = "host"
You can’t perform that action at this time.
0 commit comments