]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
monitor process exited by signal SIGKILL, clean cgroup resource by third party 3337/head
authorcenxianlong <cenxianlong@huawei.com>
Sat, 28 Mar 2020 00:52:26 +0000 (02:52 +0200)
committercenxianlong <cenxianlong@huawei.com>
Sat, 28 Mar 2020 01:16:27 +0000 (03:16 +0200)
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>
src/lxc/cgroups/cgfsng.c

index effbf11a8735cb8322a2e8930d0bfbb659a2566e..f0ed0d312ae271179cf74903670334f26d5e7a2e 100644 (file)
@@ -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: