アクションと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にはこれら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に関連していますか?

cgroup.procs cpu.maxとを使用するには、cgroupv2を更新してくださいcpuset.cpus。このファイルは編集可能です。cpu.sharesたとえば、このフォルダに新しいファイルを作成しようとするたびにアクセス許可が拒否されるようです。スティッキービート? ?

ベストアンサー1

フラグ()をrm使って渡してみましたか?それでも動作しない場合は、おそらく動作します。-rfrm -rf testrmdir test

おすすめ記事