Commit eb4468c5 authored by Martin Pitt's avatar Martin Pitt Committed by Michael Biebl

Clean up closing empty sessions when not running under systemd

In logind's manager_gc(), submit "closing" session to garbage collection, to
clean them up once they are empty. This is usually triggered through
manager_cgroup_notify_empty() from a org.freedesktop.systemd1.Agent.Released
signal, but that doesn't happen when not running under systemd.
parent 3efc9691
......@@ -1371,9 +1371,17 @@ void manager_gc(Manager *m, bool drop_not_started) {
Seat *seat;
Session *session;
User *user;
Iterator i;
assert(m);
/* clean up empty sessions when not running under systemd */
if (!sd_booted()) {
HASHMAP_FOREACH(session, m->session_cgroups, i)
if (session_get_state(session) == SESSION_CLOSING)
session_add_to_gc_queue(session);
}
while ((seat = m->seat_gc_queue)) {
LIST_REMOVE(Seat, gc_queue, m->seat_gc_queue, seat);
seat->in_gc_queue = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment