作为一个实验,我试图在tasks
中添加一些进程并修改一些cpu.shares
。
我在/sys/fs/cgroup/cpu
中创建了一个文件夹test
$ 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
1条答案
按热度按时间tsm1rwdh1#
这可能对任何遇到同样问题的人都有帮助。我通过运行“rmdir”而不是“rm”来修复它。