Unverified Commit e5da28dd by cenxianlong Committed by Stéphane Graber

monitor process exited by signal SIGKILL, clean cgroup resource by third party

Writing the value 0 to a cgroup.procs file causes the writing process to be moved to the corresponding cgroup Signed-off-by: 's avatarcenxianlong <cenxianlong@huawei.com>
parent 7457a8b8
...@@ -1098,11 +1098,13 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops, ...@@ -1098,11 +1098,13 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
goto try_recursive_destroy; goto try_recursive_destroy;
} }
if (handler->monitor_pid != 0) {
ret = lxc_write_openat(pivot_path, "cgroup.procs", pidstr, len); ret = lxc_write_openat(pivot_path, "cgroup.procs", pidstr, len);
if (ret != 0) { if (ret != 0) {
SYSWARN("Failed to move monitor %s to \"%s\"", pidstr, pivot_path); SYSWARN("Failed to move monitor %s to \"%s\"", pidstr, pivot_path);
continue; continue;
} }
}
try_recursive_destroy: try_recursive_destroy:
ret = recursive_destroy(h->monitor_full_path); ret = recursive_destroy(h->monitor_full_path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment