Skip to content

Commit

Permalink
Give friendlier messages when cgroup v2 is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikaa committed Oct 4, 2024
1 parent 4766134 commit 24c5c05
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/bash

CGROUP_FS="/sys/fs/cgroup"
if [ ! -e "$CGROUP_FS" ]; then
echo "Cannot find $CGROUP_FS. Please make sure your system is using cgroup v2"
exit 1
fi

if [ -e "$CGROUP_FS/unified" ]; then
echo "Combined cgroup v1+v2 mode is not supported. Please make sure your system is using pure cgroup v2"
exit 1
fi

if [ ! -e "$CGROUP_FS/cgroup.subtree_control" ]; then
echo "Cgroup v2 not found. Please make sure cgroup v2 is enabled on your system"
exit 1
fi

cd /sys/fs/cgroup && \
mkdir isolate/ && \
echo 1 > isolate/cgroup.procs && \
Expand Down

0 comments on commit 24c5c05

Please sign in to comment.