From: Umut Tezduyar Lindskog <umut.tezduyar@axis.com>
Date: Tue, 15 Jul 2014 08:36:29 +0200
Subject: core: fix oneshot service resource control

Oneshot services's cgroup is removed when the service
exits. An assert is hit otherwise.

(cherry picked from commit 285cd771cbe275265e165bdb5650b92b31eeab47)
---
 src/core/manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/core/manager.c b/src/core/manager.c
index 0cb2044..edcde31 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -2539,7 +2539,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);
 
