chiark / gitweb /
logind: release VT-positions when closing sessions
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 31 Jul 2015 14:52:29 +0000 (16:52 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:07:22 +0000 (10:07 +0100)
Make sure we release VT-positions when a session is closed. Otherwise,
lingering sessions will occupy VTs and prevent next logins from
succeeding.

Note that we already release session-devices when closing a session, so
there cannot be anyone using the VT anymore.

src/login/logind-session.c

index 8950c719058c3f6737cbb8393d22e042df7f796f..30380ae52f9426f69154da98cd40787f3112676f 100644 (file)
@@ -630,6 +630,9 @@ int session_stop(Session *s, bool force) {
 
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
 
 
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
 
+        if (s->seat)
+                seat_evict_position(s->seat, s);
+
         /* We are going down, don't care about FIFOs anymore */
         session_remove_fifo(s);
 
         /* We are going down, don't care about FIFOs anymore */
         session_remove_fifo(s);
 
@@ -666,6 +669,9 @@ int session_finalize(Session *s) {
 
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
 
 
         s->timer_event_source = sd_event_source_unref(s->timer_event_source);
 
+        if (s->seat)
+                seat_evict_position(s->seat, s);
+
         /* Kill session devices */
         while ((sd = hashmap_first(s->devices)))
                 session_device_free(sd);
         /* Kill session devices */
         while ((sd = hashmap_first(s->devices)))
                 session_device_free(sd);