Program run with sudo cannot create cgroup on raspberry pi

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Program run with sudo cannot create cgroup on raspberry pi

Post by /RaspberryPi »


Hey,
I am writing a program which creates some processes and puts them into a cgroup to limit their resource usage (cpu and memory)

On my linux mint laptop I have achieved this by doing this:

run.sh: set -e make sudo DDPPATH=$DDPPATH PATH=$PATH ./Spielplatz because without sudo I do not have permissions to work with cgroups and the program needs both those environment variables.

Now a friend wants to run this program on his raspberry pi 4 Model B (runs Raspberry Pi OS 64-bit) but he gets a permission denied error:

open /sys/fs/cgroup/ddp_playground/cpu.max: permission denied Why does it not work for him? The cgroups feature itself is supported or else my program would report a different error, and he can create a cgroup himself using sudo mkdir /sys/fs/cgroup/test_group

I have already posted this here without any result.
We did what the linked stackoverflow post said (which enable cgroups v1 and v2, which should not matter as we only use v2) but it didn't help
submitted by /u/bafto14
[link] [comments]

Source: https://www.reddit.com/r/raspberry_pi/c ... cgroup_on/
/RaspberryPi
Post Reply

Return to “Raspberry Pi Forum”