summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-05 23:04:51 +0200
committerLukáš Nykrýn <lnykryn@redhat.com>2019-05-02 10:50:21 +0200
commit7b629b3a853c3b1e4e6a916a080996960343d7f2 (patch)
tree0e34a65cb7cb33b0785bd79f34eaae63f7bf16f7
parent37c1da056b63323514d71d2832a01ea916f004cc (diff)
downloadsystemd-7b629b3a853c3b1e4e6a916a080996960343d7f2.tar.gz
unit: enqueue cgroup empty check event if the last ref on a unit is dropped
(cherry picked from commit e5c36295d81971ef75d9c6f98f0890b92a4a353f) Resolves: #1697893
-rw-r--r--src/core/dbus-unit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index ae0410414e..c5bca10979 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -1746,7 +1746,13 @@ static int bus_unit_track_handler(sd_bus_track *t, void *userdata) {
u->bus_track = sd_bus_track_unref(u->bus_track); /* make sure we aren't called again */
+ /* If the client that tracks us disappeared, then there's reason to believe that the cgroup is empty now too,
+ * let's see */
+ unit_add_to_cgroup_empty_queue(u);
+
+ /* Also add the unit to the GC queue, after all if the client left it might be time to GC this unit */
unit_add_to_gc_queue(u);
+
return 0;
}