]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: don't rely on absolute path
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 09:06:29 +0000 (10:06 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 09:06:29 +0000 (10:06 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 0d32469e70112b7969737f16c6bf0356669fead0..ddec3ad82b06cead25e04f5ce7d342a40ac2029e 100644 (file)
@@ -1225,6 +1225,11 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
        }
        conf = handler->conf;
 
+       if (!ops->monitor_cgroup) {
+               WARN("Uninitialized monitor cgroup");
+               return;
+       }
+
        len = strnprintf(pidstr, sizeof(pidstr), "%d", handler->monitor_pid);
        if (len < 0)
                return;
@@ -1236,9 +1241,6 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
                bool cpuset_v1 = false;
                int ret;
 
-               if (!h->monitor_full_path)
-                       continue;
-
                /* Monitor might have died before we entered the cgroup. */
                if (handler->monitor_pid <= 0) {
                        WARN("No valid monitor process found while destroying cgroups");