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;
/* 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)
while ((seat = m->seat_gc_queue)) {
LIST_REMOVE(Seat, gc_queue, m->seat_gc_queue, seat);
seat->in_gc_queue = false;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment