Skip to content

Commit

Permalink
monitor process exited by signal SIGKILL, clean cgroup resource by th…
Browse files Browse the repository at this point in the history
…ird party

Writing the value 0 to a cgroup.procs file causes the
writing process to be moved to the corresponding cgroup

Signed-off-by: cenxianlong <cenxianlong@huawei.com>
  • Loading branch information
bale-cen authored and stgraber committed Mar 28, 2020
1 parent 7457a8b commit e5da28d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -1098,10 +1098,12 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
goto try_recursive_destroy;
}

ret = lxc_write_openat(pivot_path, "cgroup.procs", pidstr, len);
if (ret != 0) {
SYSWARN("Failed to move monitor %s to \"%s\"", pidstr, pivot_path);
continue;
if (handler->monitor_pid != 0) {
ret = lxc_write_openat(pivot_path, "cgroup.procs", pidstr, len);
if (ret != 0) {
SYSWARN("Failed to move monitor %s to \"%s\"", pidstr, pivot_path);
continue;
}
}

try_recursive_destroy:
Expand Down

0 comments on commit e5da28d

Please sign in to comment.