작업 및 cpu.shares 수정 권한이 거부되었습니다.

작업 및 cpu.shares 수정 권한이 거부되었습니다.

실험적으로 일부 프로세스를 추가 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에는 이 두 파일이 표시되지 않습니다. (태스크 파일에 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

그런데 왜 이 파일을 편집하거나 생성된 폴더를 삭제할 수 없나요? 루트 사용자로 명령을 실행해 보았습니다.

운영 체제: 우분투 22.04.1

group.controllers도 볼 수 있습니다.....이것은 cgroupv2와 관련이 있습니까?

cgroup.procs cpu.max및 를 사용하려면 cgroupv2를 업데이트하세요 cpuset.cpus. 이 파일은 편집 가능합니다. cpu.shares예를 들어 이 폴더에 새 파일을 만들 려고 할 때마다 권한이 거부되는 것 같습니다 . 끈적한 비트? ?

답변1

플래그( )를 rm사용하여 전달해 보셨나요 ? 그래도 작동하지 않으면 아마도 작동할 것입니다.-rfrm -rf testrmdir test

관련 정보