Now updating my machines to stretch, I see this issue is still present,
now in systemd version 232-25. The same steps can reproduce:
 - Set up cgroups e.g. adding TaskIDs to /sys/fs/cgroup/cpu/DIR/tasks
   files. (I use cgrulesengd from package cgroup-tools, but any other
   use of cgroups is equally affected.)
 - Then when you use systemd commands:
     systemctl daemon-reload
     systemctl start anacron
   you will see your cgroups (your tasks files) becoming empty.
   Command daemon-reload seems to happen within "apt-get dist-upgrade"
   sequences, and "start anacron" happens nightly. (Some other systemd
   commands may also affect.)
and the "same" fix applies: new patch file below, for changed sources.

Please update the list of versions affected by the bug. Maybe you could
set the severity back to critical: it does break unrelated software in
a default setup.

(Distressing how this bug did not get fixed in two years...)

Thanks, Paul

--
Paul Szabo   p...@maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia
diff -r -U17 a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
--- a/src/basic/cgroup-util.c	2017-07-20 09:32:36.000000000 +1000
+++ b/src/basic/cgroup-util.c	2017-07-20 09:41:31.000000000 +1000
@@ -369,34 +369,44 @@
 int cg_migrate(
                 const char *cfrom,
                 const char *pfrom,
                 const char *cto,
                 const char *pto,
                 CGroupFlags flags) {
 
         bool done = false;
         _cleanup_set_free_ Set *s = NULL;
         int r, ret = 0;
         pid_t my_pid;
 
         assert(cfrom);
         assert(pfrom);
         assert(cto);
         assert(pto);
 
+        /*
+         * PSz 25 Oct 2015
+         * An empty "to" path is surely wrong (do not annoy cgroups that not ours)
+         */
+        if (!strlen(pto)) {
+                /* log_warning("Debug: cg_migrate skip from (%s)%s to (%s)%s", cfrom, pfrom, cto, pto); */
+                return ret;
+        }
+        /* log_warning("Debug: cg_migrate do from (%s)%s to (%s)%s", cfrom, pfrom, cto, pto); */
+
         s = set_new(NULL);
         if (!s)
                 return -ENOMEM;
 
         my_pid = getpid();
 
         do {
                 _cleanup_fclose_ FILE *f = NULL;
                 pid_t pid = 0;
                 done = true;
 
                 r = cg_enumerate_processes(cfrom, pfrom, &f);
                 if (r < 0) {
                         if (ret >= 0 && r != -ENOENT)
                                 return r;
 
                         return ret;
_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to