作为一个实验,我试图在tasks中添加一些进程,并修改一些cpu.shares。但是,如果我试图运行以下命令,则会被拒绝权限
我在test中创建了一个文件夹/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另外,文件夹的ls不显示这2个文件。(因为任务文件中没有PID?)
此外,如果我试图删除test文件夹,我不能。我知道错误了
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但是为什么我不能编辑这些文件或者删除这个创建的文件夹呢?我尝试以root用户的身份运行这些命令。
操作系统: Ubuntu 22.04.1
我也能看到group.controllers.这和cgroupv2有关吗?
Update cgroupv2使用cgroup.procs cpu.max和cpuset.cpus。这些文件是可编辑的。似乎每当我试图在这个文件夹中创建一个新文件(如cpu.shares)时,权限就会被拒绝。粘糊糊的碎片?
发布于 2022-08-20 20:18:35
您是否尝试过传递带有rm标志的-rf (rm -rf test)?如果这不起作用,也许rmdir test就能工作。
https://unix.stackexchange.com/questions/714161
复制相似问题