chiark / gitweb /
cgroup: don't accidentaly trim on reload
[elogind.git] / src / service.c
index 7f8d005f00882f21bfcba666cc347b3b1ed8dc9d..0845d21bad1d9a18f3442cda37250778d8ab775d 100644 (file)
@@ -1470,7 +1470,7 @@ static void service_set_state(Service *s, ServiceState state) {
 
         /* For the inactive states unit_notify() will trim the cgroup,
          * but for exit we have to do that ourselves... */
-        if (state == SERVICE_EXITED)
+        if (state == SERVICE_EXITED && s->meta.manager->n_deserializing <= 0)
                 cgroup_bonding_trim_list(s->meta.cgroup_bondings, true);
 
         if (old_state != state)