Bug 1415 - systemd是239版本,执行systemctl daemon-reload的时候会修改cgroup,比如清空/sys/fs/cgroup/cpu/test/cgroup.procs
Summary: systemd是239版本,执行systemctl daemon-reload的时候会修改cgroup,比如清空/sys/fs/cgroup/cpu/te...
Status: IN_PROGRESS
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 8.5
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: 杨枝甘露瑞纳冰
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-07 16:24 UTC by Xiewei
Modified: 2022-07-06 15:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xiewei 2022-06-07 16:24:37 UTC
Description of problem:
systemd是239版本,执行systemctl daemon-reload的时候会修改cgroup,比如清空/sys/fs/cgroup/cpu/test/cgroup.procs
升级到251后问题解决

Version-Release number of selected component (if applicable):
systemd-239-51.0.2.an8_5.3.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 杨枝甘露瑞纳冰 alibaba_cloud_group 2022-07-06 15:43:02 UTC
你好,据我理解您应该是自己创建了test子目录,然后echo一个pid进去的是么?

systemd从235版本开始会在daemon reload跟restart的时候做cgroup的刷新操作,是这个commit引入的: https://github.com/systemd/systemd/commit/58d83430e1276fe8d1224c2b5f76e756d143a375

systemd本身会对服务及其子进程的cgroup进行管理,所以不推荐自己创建cgroup子目录然后echo pid的做法,因为这样的做法systemd感知不到,信息没有被记录到,所以reload之后就被清空了。systemd有官方推荐做法,参考这个issue: https://github.com/systemd/systemd/issues/15496

关于升级251之后问题解决这一点,请问您是如何升级的呢?Anolis本身没有提供更高版本的systemd。