lightdm multiseat minimum-vt > 7 breaks console on boot

Bug #1016504 reported by Thorsten Kohfeldt
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Light Display Manager
New
Medium
Unassigned

Bug Description

Booting Oneiric or Precise with the following lightdm.conf "screws up" console vt switching.
The intention of the following lightdm.conf is having an X login screen on vt 10, vt 11 and vt 12.
Because lightdm has an internal error "allocating" vt 10 TWICE on boot (i.e. when interacting with Plymouth),
the console switching (Alt Fn respectively Alt+Ctrl Fn) starts behaving funny.
A TEXT console login on vt 2 followed by a "sudo su -" initiates a mouseless (i.e. almost unusable) X session (!).

One time in Oneiric, when trying to log into the graphical session I even had a CLEAR TEXT PASSWORD dialog residue on the screen after the X server was crashing.

Tested lightdm versions:
1.2.1, 1.2.2 and 1.3.1

At the end of this report I suggest a patch which fits all 3 versions.

------------------------------------------------------
cat lightdm.conf

[LightDM]
minimum-vt=10
minimum-display-number=10
seats=Seat:1 Seat:2 Seat:3
start-default-seat=false
greeter-user=lightdm

[SeatDefaults]
greeter-session=lightdm-gtk-greeter
user-session=xubuntu
allow-guest=false

[Seat:1]

[Seat:2]

[Seat:3]

[XDMCPServer]
enabled=true
port=177
------------------------------------------------------
[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.2.1, UID=0 PID=1270
[+0.01s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf
[+0.01s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.01s] DEBUG: Registered seat module xlocal
[+0.01s] DEBUG: Registered seat module xremote
[+0.01s] DEBUG: Loading seat Seat:1
[+0.01s] DEBUG: Starting seat
[+0.01s] DEBUG: Starting new display for greeter
[+0.01s] DEBUG: Starting local X display
[+0.13s] DEBUG: Plymouth is running on VT 7, but this is less than the configured minimum of 10 so not replacing it
[+0.13s] DEBUG: Using VT 10
[+0.13s] DEBUG: Activating VT 10
[+0.15s] DEBUG: Logging to /var/log/lightdm/x-10.log
[+0.19s] DEBUG: Writing X server authority to /var/run/lightdm/root/:10
[+0.20s] DEBUG: Launching X Server
[+0.20s] DEBUG: Launching process 1301: /usr/bin/X :10 -auth /var/run/lightdm/root/:10 -nolisten tcp vt10 -novtswitch
[+0.22s] DEBUG: Waiting for ready signal from X server :10
[+0.22s] DEBUG: Loading seat Seat:2
[+0.22s] DEBUG: Starting seat
[+0.22s] DEBUG: Starting new display for greeter
[+0.22s] DEBUG: Starting local X display
[+0.22s] DEBUG: X server :11 will replace Plymouth
[+0.31s] DEBUG: Using VT 10
[+0.31s] DEBUG: Activating VT 10
[+0.32s] DEBUG: Logging to /var/log/lightdm/x-11.log
[+0.32s] DEBUG: Writing X server authority to /var/run/lightdm/root/:11
[+0.32s] DEBUG: Launching X Server
[+0.32s] DEBUG: Launching process 1369: /usr/bin/X :11 -auth /var/run/lightdm/root/:11 -nolisten tcp vt10 -novtswitch -background none
[+0.32s] DEBUG: Waiting for ready signal from X server :11
[+0.32s] DEBUG: Loading seat Seat:3
[+0.32s] DEBUG: Starting seat
[+0.32s] DEBUG: Starting new display for greeter
[+0.32s] DEBUG: Starting local X display
[+0.32s] DEBUG: Using VT 11
[+0.32s] DEBUG: Activating VT 11
[+0.36s] DEBUG: Logging to /var/log/lightdm/x-12.log
[+0.36s] DEBUG: Writing X server authority to /var/run/lightdm/root/:12
[+0.37s] DEBUG: Launching X Server
[+0.40s] DEBUG: Launching process 1373: /usr/bin/X :12 -auth /var/run/lightdm/root/:12 -nolisten tcp vt11 -novtswitch
[+0.40s] DEBUG: Waiting for ready signal from X server :12
[+0.40s] DEBUG: Starting XDMCP server on UDP/IP port 177
[+0.40s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.40s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.45s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat1
[+0.47s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat2
...
------------------------------------------------------

Proposed patch:

diff -rupN lightdm-1.2.2.org/src/vt.c lightdm-1.2.2-VTpatch/src/vt.c
--- lightdm-1.2.2.org/src/vt.c 2012-04-19 01:29:23.000000000 +0200
+++ lightdm-1.2.2-VTpatch/src/vt.c 2012-06-20 10:33:47.898146259 +0200
@@ -95,7 +95,7 @@ vt_set_active (gint number)
 #endif
 }

-static gboolean
+gboolean
 vt_is_used (gint number)
 {
     GList *link;
diff -rupN lightdm-1.2.2.org/src/vt.h lightdm-1.2.2-VTpatch/src/vt.h
--- lightdm-1.2.2.org/src/vt.h 2012-04-19 01:29:23.000000000 +0200
+++ lightdm-1.2.2-VTpatch/src/vt.h 2012-06-20 10:35:48.130149351 +0200
@@ -14,6 +14,8 @@

 #include <glib-object.h>

+gboolean vt_is_used (gint number);
+
 gint vt_get_active (void);

 gint vt_get_unused (void);
diff -rupN lightdm-1.2.2.org/src/xserver-local.c lightdm-1.2.2-VTpatch/src/xserver-local.c
--- lightdm-1.2.2.org/src/xserver-local.c 2012-04-19 01:29:23.000000000 +0200
+++ lightdm-1.2.2-VTpatch/src/xserver-local.c 2012-06-15 14:16:51.847135083 +0200
@@ -136,10 +136,17 @@ xserver_local_new (void)
         gint active_vt = vt_get_active ();
         if (active_vt >= vt_get_min ())
         {
- g_debug ("X server %s will replace Plymouth", xserver_get_address (XSERVER (self)));
- self->priv->replacing_plymouth = TRUE;
- self->priv->vt = active_vt;
- plymouth_deactivate ();
+ if (vt_is_used (active_vt))
+ {
+ g_debug ("Plymouth now seems to be running on VT %d, which is already used by another X server", active_vt);
+ }
+ else
+ {
+ g_debug ("X server %s will replace Plymouth", xserver_get_address (XSERVER (self)));
+ self->priv->replacing_plymouth = TRUE;
+ self->priv->vt = active_vt;
+ plymouth_deactivate ();
+ }
         }
         else
             g_debug ("Plymouth is running on VT %d, but this is less than the configured minimum of %d so not replacing it", active_vt, vt_get_min ());
------------------------------------------------------

Log of successfull boot with patched lightdm, preventing duplicate allocation of vt 10:

[+0.00s] DEBUG: Logging to //var/log/lightdm/lightdm.log
[+0.01s] DEBUG: Starting Light Display Manager 1.2.2, UID=0 PID=1293
[+0.01s] DEBUG: Loaded configuration from //etc/lightdm/lightdm.conf
[+0.01s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.13s] DEBUG: Registered seat module xlocal
[+0.23s] DEBUG: Registered seat module xremote
[+0.23s] DEBUG: Loading seat Seat:1
[+0.24s] DEBUG: Starting seat
[+0.24s] DEBUG: Starting new display for greeter
[+0.24s] DEBUG: Starting local X display
[+0.27s] DEBUG: Plymouth is running on VT 7, but this is less than the configured minimum of 10 so not replacing it
[+0.28s] DEBUG: Using VT 10
[+0.28s] DEBUG: Activating VT 10
[+0.30s] DEBUG: Logging to //var/log/lightdm/x-10.log
[+0.55s] DEBUG: Writing X server authority to //var/run/lightdm/root/:10
[+0.55s] DEBUG: Launching X Server
[+0.56s] DEBUG: Launching process 1317: /usr/bin/X :10 -auth //var/run/lightdm/root/:10 -nolisten tcp vt10 -novtswitch
[+0.56s] DEBUG: Waiting for ready signal from X server :10
[+0.56s] DEBUG: Loading seat Seat:2
[+0.56s] DEBUG: Starting seat
[+0.56s] DEBUG: Starting new display for greeter
[+0.56s] DEBUG: Starting local X display
[+0.57s] DEBUG: Plymouth now seems to be running on VT 10, which is already used by another X server
[+0.57s] DEBUG: Using VT 11
[+0.57s] DEBUG: Activating VT 11
[+0.61s] DEBUG: Logging to //var/log/lightdm/x-11.log
[+0.61s] DEBUG: Writing X server authority to //var/run/lightdm/root/:11
[+0.61s] DEBUG: Launching X Server
[+0.61s] DEBUG: Launching process 1319: /usr/bin/X :11 -auth //var/run/lightdm/root/:11 -nolisten tcp vt11 -novtswitch
[+0.61s] DEBUG: Waiting for ready signal from X server :11
[+0.61s] DEBUG: Loading seat Seat:3
[+0.61s] DEBUG: Starting seat
[+0.61s] DEBUG: Starting new display for greeter
[+0.63s] DEBUG: Starting local X display
[+0.65s] DEBUG: Plymouth now seems to be running on VT 11, which is already used by another X server
[+0.65s] DEBUG: Using VT 12
[+0.65s] DEBUG: Activating VT 12
[+0.68s] DEBUG: Logging to //var/log/lightdm/x-12.log
[+0.68s] DEBUG: Writing X server authority to //var/run/lightdm/root/:12
[+0.68s] DEBUG: Launching X Server
[+0.68s] DEBUG: Launching process 1320: /usr/bin/X :12 -auth //var/run/lightdm/root/:12 -nolisten tcp vt12 -novtswitch
[+0.68s] DEBUG: Waiting for ready signal from X server :12
[+0.68s] DEBUG: Stopping Plymouth, no displays replace it
[+0.87s] DEBUG: Starting XDMCP server on UDP/IP port 177
[+0.87s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.87s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.99s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat1
[+1.05s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat2
[+5.91s] DEBUG: Got signal 10 from process 1319
[+5.91s] DEBUG: Got signal from X server :11
[+5.91s] DEBUG: Connecting to XServer :11
[+5.94s] DEBUG: Starting greeter
[+5.95s] DEBUG: Started session 1484 with service 'lightdm', username 'lightdm'
[+6.42s] DEBUG: Session 1484 authentication complete with return value 0: Success
[+6.42s] DEBUG: Greeter authorized
[+6.42s] DEBUG: Logging to //var/log/lightdm/x-11-greeter.log
[+6.46s] DEBUG: Session 1484 running command /usr/sbin/lightdm-gtk-greeter
[+9.06s] DEBUG: Greeter connected version=1.2.1
[+9.06s] DEBUG: Greeter connected, display is ready
[+9.06s] DEBUG: New display ready, switching to it
[+9.06s] DEBUG: Activating VT 11
[+14.72s] DEBUG: Greeter start authentication for installator
[+14.72s] DEBUG: Started session 1796 with service 'lightdm', username 'installator'
[+14.91s] DEBUG: Session 1796 got 1 message(s) from PAM
[+14.91s] DEBUG: Prompt greeter with 1 message(s)
[+37.89s] DEBUG: Got signal 10 from process 1317
[+37.89s] DEBUG: Got signal from X server :10
[+37.89s] DEBUG: Connecting to XServer :10
[+37.90s] DEBUG: Starting greeter
[+37.90s] DEBUG: Started session 1805 with service 'lightdm', username 'lightdm'
[+38.08s] DEBUG: Session 1805 authentication complete with return value 0: Success
[+38.08s] DEBUG: Greeter authorized
[+38.08s] DEBUG: Logging to //var/log/lightdm/x-10-greeter.log
[+38.08s] DEBUG: Session 1805 running command /usr/sbin/lightdm-gtk-greeter
[+38.49s] DEBUG: Greeter connected version=1.2.1
[+38.49s] DEBUG: Greeter connected, display is ready
[+38.49s] DEBUG: New display ready, switching to it
[+38.49s] DEBUG: Activating VT 10
[+38.99s] DEBUG: Greeter start authentication for installator
[+38.99s] DEBUG: Started session 1835 with service 'lightdm', username 'installator'
[+39.10s] DEBUG: Session 1835 got 1 message(s) from PAM
[+39.10s] DEBUG: Prompt greeter with 1 message(s)
[+48.69s] DEBUG: Got signal 10 from process 1320
[+48.69s] DEBUG: Got signal from X server :12
[+48.69s] DEBUG: Connecting to XServer :12
[+48.70s] DEBUG: Starting greeter
[+48.71s] DEBUG: Started session 1845 with service 'lightdm', username 'lightdm'
[+48.88s] DEBUG: Session 1845 authentication complete with return value 0: Success
[+48.88s] DEBUG: Greeter authorized
[+48.88s] DEBUG: Logging to //var/log/lightdm/x-12-greeter.log
[+48.88s] DEBUG: Session 1845 running command /usr/sbin/lightdm-gtk-greeter
[+49.28s] DEBUG: Greeter connected version=1.2.1
[+49.28s] DEBUG: Greeter connected, display is ready
[+49.28s] DEBUG: New display ready, switching to it
[+49.28s] DEBUG: Activating VT 12
[+49.77s] DEBUG: Greeter start authentication for installator
[+49.78s] DEBUG: Started session 1875 with service 'lightdm', username 'installator'
[+49.88s] DEBUG: Session 1875 got 1 message(s) from PAM
[+49.88s] DEBUG: Prompt greeter with 1 message(s)

Tags: multiseat
Revision history for this message
Thorsten Kohfeldt (thorsten-kohfeldt) wrote :
Changed in lightdm:
importance: Undecided → Medium
tags: added: multiseat
Changed in lightdm:
assignee: nobody → svininykh@gmail.com (svininykh)
assignee: svininykh@gmail.com (svininykh) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.