As an experiment I was trying to add some processes in tasks
and modify some cpu.shares
. However I get Permission denied if I try to run commands like
I created a folder test
inside of /sys/fs/cgroup/cpu
$ sudo -s
$whoami
root
$ echo 2472 > tasks
-bash: tasks: Permission denied
$sudo echo 10 > cpu.shares
-bash: cpu.shares: Permission denied
Also, an ls of the folder does not show these 2 files. (Because no PIDs in the task file??)
Also, if I try to delete the test
folder, I cant. I get the error
rm: cannot remove 'test/cgroup.events': Operation not permitted
rm: cannot remove 'test/io.pressure': Operation not permitted
rm: cannot remove 'test/cgroup.procs': Operation not permitted
rm: cannot remove 'test/cgroup.max.descendants': Operation not permitted
rm: cannot remove 'test/cpu.stat': Operation not permitted
rm: cannot remove 'test/memory.pressure': Operation not permitted
rm: cannot remove 'test/cpu.pressure': Operation not permitted
rm: cannot remove 'test/cgroup.type': Operation not permitted
rm: cannot remove 'test/cgroup.stat': Operation not permitted
rm: cannot remove 'test/cgroup.threads': Operation not permitted
rm: cannot remove 'test/cgroup.kill': Operation not permitted
rm: cannot remove 'test/cgroup.freeze': Operation not permitted
rm: cannot remove 'test/cgroup.controllers': Operation not permitted
rm: cannot remove 'test/cgroup.subtree_control': Operation not permitted
rm: cannot remove 'test/cgroup.max.depth': Operation not permitted
But why am I not able to edit these files or delete this created folder? I tried running the commands as a root user OS: Ubuntu 22.04.1