diff --git a/container/entry.sh b/container/entry.sh index 7c09f37..b2969c7 100644 --- a/container/entry.sh +++ b/container/entry.sh @@ -6,7 +6,16 @@ fi function do_cgroup { docker_container=$(cat /proc/1/cgroup | sed 's/0::.\+\/\(.\+\)/\1/') + if [[ -z "$docker_container" ]]; then + echo "Could not determine container group base" + return + fi + cgpath=$(find /sys/fs/cgroup -type d -iname $docker_container)"/../" + if [[ ! -d "$cgpath" ]]; then + echo "Cgroup path not found for $docker_container" + return + fi for f in "$cgpath"*/memory.swap.max; do echo "Setting cgroup: $f"