aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-12-07 08:30:04 +0000
committerGravatar GitHub <[email protected]>2021-12-07 08:30:04 +0000
commit80c7318faf9c5b1364b58759b1d66e2e28bc8ce5 (patch)
treed0e26f9560731225a97adbc065f4799b7394e6b1
parentAdd the --use_cgroupv2 flag when relevant (diff)
Log cgroup version at startup
-rw-r--r--snekbox/nsjail.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py
index cb18392..fbc6bcf 100644
--- a/snekbox/nsjail.py
+++ b/snekbox/nsjail.py
@@ -44,10 +44,12 @@ class NsJail:
def __init__(self, nsjail_binary: str = NSJAIL_PATH):
self.nsjail_binary = nsjail_binary
self.config = self._read_config()
-
+
+ log.info(f"Cgroups version: {self._probe_cgroup_version()}")
+
@staticmethod
def _probe_cgroup_version() -> int:
- """Poll the filesystem and return the guessed cgroup version"""
+ """Poll the filesystem and return the guessed cgroup version."""
# Right now we check whenever the controller path exists
version = 2 if CGROUPV2_PROBE_PATH.exists() else 1