chiark / gitweb /
core: fix oneshot service resource control
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>
Tue, 15 Jul 2014 06:36:29 +0000 (08:36 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 15 Jul 2014 14:08:01 +0000 (10:08 -0400)
Oneshot services's cgroup is removed when the service
exits. An assert is hit otherwise.

src/core/manager.c

index 3dffbe2..e7a3a2a 100644 (file)
@@ -2542,7 +2542,8 @@ void manager_check_finished(Manager *m) {
         }
 
         SET_FOREACH(u, m->startup_units, i)
-                cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
+                if (u->cgroup_path)
+                        cgroup_context_apply(unit_get_cgroup_context(u), unit_get_cgroup_mask(u), u->cgroup_path, manager_state(m));
 
         bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);