Package: lightdm
Version: 1.18.3-5
Severity: normal
Tags: patch upstream

If one seat of multiseat setup is not configured properly, lightdm restarts
it in a endless loop, consuming up to 100% CPU and polluting logs.

Including a patch that adds half a second delay before a greeter restart.


-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-0.bpo.2-amd64 (SMP w/8 CPU cores)
Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8), LANGUAGE=ru_RU:ru 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lightdm depends on:
ii  adduser                                3.115
ii  consolekit                             0.4.6-6
ii  dbus                                   1.10.26-0+deb9u1
ii  debconf [debconf-2.0]                  1.5.61
ii  libaudit1                              1:2.6.7-2
ii  libc6                                  2.24-11+deb9u3
ii  libgcrypt20                            1.7.6-2+deb9u3
ii  libglib2.0-0                           2.50.3-2
ii  libpam-systemd                         237-3~bpo9+1
ii  libpam0g                               1.1.8-3.6
ii  libxcb1                                1.12-1
ii  libxdmcp6                              1:1.1.2-3
ii  lightdm-gtk-greeter [lightdm-greeter]  2.0.2-1
ii  lsb-base                               9.20161125

Versions of packages lightdm recommends:
ii  xserver-xorg  1:7.7+19

Versions of packages lightdm suggests:
ii  accountsservice  0.6.43-1
ii  upower           0.99.4-4+b1
pn  xserver-xephyr   <none>

-- Configuration Files:
/etc/lightdm/lightdm.conf changed:
[LightDM]
logind-load-seats=true
[Seat:*]
[Seat:seat-1]
xserver-config=/etc/X11/xorg.conf.seat-1
[Seat:seat-2]
xserver-config=/etc/X11/xorg.conf.seat-2
xserver-command=/usr/local/bin/Xintel
[XDMCPServer]
[VNCServer]


-- debconf information:
* shared/default-x-display-manager: lightdm
  lightdm/daemon_name: /usr/sbin/lightdm
Description: fix high CPU usage on partially configured multiseat
 If one seat of multiseat setup is not configured properly, lightdm restarts
 it in a endless loop, consuming up to 100% CPU and polluting logs. This fix
 adds a half second delay before a greeter restart.
 .
 lightdm (1.18.3-5) experimental; urgency=medium
 .
   * debian/control:
     - add liblightdm-qt5-3-0 and liblightdm-qt5-3-dev (packaging bits imported
     from Ubuntu)                                                closes: #871840
     - add build-dep on qtbase5-dev
     - move libraries to section libs
     - update standards version to 4.1.0
     - replace dh-systemd build-dep by a newer version of debhelper
   * debian/liblightdm-qt5-3-0.install and debian/liblightdm-qt5-3-dev.install
     added to ship relevant files to Qt5 library and development packages
   * debian/liblightdm-qt-dev.install:
     - narrow installation path to only cover Qt4 library.
   * debian/rules:
     - explicitly enable qt5 library
Author: Yves-Alexis Perez <cor...@debian.org>
Bug-Debian: https://bugs.debian.org/871840

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2018-10-01

--- lightdm-1.18.3.orig/src/seat.c
+++ lightdm-1.18.3/src/seat.c
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (C) 2010-2011 Robert Ancell.
  * Author: Robert Ancell <robert.anc...@canonical.com>
@@ -434,6 +435,20 @@ check_stopped (Seat *seat)
     }
 }
 
+
+static gboolean
+call_seat_switch_to_greater(gpointer data)
+{
+       Seat *seat = (Seat *)data;
+       if(!seat_switch_to_greeter(seat))
+       {
+               l_debug (seat, "Stopping; failed to start a greeter");
+               seat_stop (seat);
+       }
+       return FALSE;
+}
+
+
 static void
 display_server_stopped_cb (DisplayServer *display_server, Seat *seat)
 {
@@ -489,12 +504,9 @@ display_server_stopped_cb (DisplayServer
         active_session = seat_get_active_session (seat);
         if (!active_session || session_get_display_server (active_session) == 
display_server)
         {
-            l_debug (seat, "Active display server stopped, starting greeter");
-            if (!seat_switch_to_greeter (seat))
-            {
-                l_debug (seat, "Stopping; failed to start a greeter");
-                seat_stop (seat);
-            }
+                                       l_debug (seat, "Active display server 
stopped, starting greeter again after delay");
+          g_timeout_add(500, call_seat_switch_to_greater, (gpointer)seat);     
                                        
+
         }
     }
 

Reply via email to