summaryrefslogtreecommitdiff
path: root/src/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit.c')
-rw-r--r--src/unit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/unit.c b/src/unit.c
index e19061c504..f50477f878 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -1876,6 +1876,9 @@ int unit_add_default_cgroups(Unit *u) {
/* Adds in the default cgroups, if they weren't specified
* otherwise. */
+ if (!u->meta.manager->cgroup_hierarchy)
+ return 0;
+
if ((r = unit_add_one_default_cgroup(u, NULL)) < 0)
return r;