From: cenxianlong Date: Sat, 28 Mar 2020 00:52:26 +0000 (+0200) Subject: monitor process exited by signal SIGKILL, clean cgroup resource by third party X-Git-Tag: lxc-5.0.0~484^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3337%2Fhead;p=thirdparty%2Flxc.git 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: cenxianlong --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index effbf11a8..f0ed0d312 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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: