首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >拒绝修改任务和cpu.shares的权限

拒绝修改任务和cpu.shares的权限
EN

Unix & Linux用户
提问于 2022-08-19 13:51:35
回答 1查看 322关注 0票数 1

作为一个实验,我试图在tasks中添加一些进程,并修改一些cpu.shares。但是,如果我试图运行以下命令,则会被拒绝权限

我在test中创建了一个文件夹/sys/fs/cgroup/cpu

代码语言:javascript
复制
$ 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文件夹,我不能。我知道错误了

代码语言:javascript
复制
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.maxcpuset.cpus。这些文件是可编辑的。似乎每当我试图在这个文件夹中创建一个新文件(如cpu.shares)时,权限就会被拒绝。粘糊糊的碎片?

EN

回答 1

Unix & Linux用户

发布于 2022-08-20 20:18:35

您是否尝试过传递带有rm标志的-rf (rm -rf test)?如果这不起作用,也许rmdir test就能工作。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/714161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档