The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3337

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
…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 <cenxianl...@huawei.com>
From 8fcb908d9f2cf4432764d944007a431001a28b10 Mon Sep 17 00:00:00 2001
From: cenxianlong <cenxianl...@huawei.com>
Date: Sat, 28 Mar 2020 02:52:26 +0200
Subject: [PATCH] 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 <cenxianl...@huawei.com>
---
 src/lxc/cgroups/cgfsng.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index effbf11a87..f0ed0d312a 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:
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to