Bug #14940


lightdm unable to switch to existing sessions

Added by Daniel Bell about 1 year ago. Updated about 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Expected behaviour

Running dm-tool --switch-to-greeter as username , then authenticating as username should cause lightdm to reactivate that user's active session.

Actual behaviour

Running dm-tool --switch-to-greeter as username, then authenticating as the same user causes a blank screen, followed shortly by the greeter login screen.
Running dm-tool --switch-to-greeter, and then authenticating as a different user, works properly.


  • Running dm-tool --switch-to-greeter as username, results in username being unable to log in.
  • Running dm-tool --switch-to-session does not work for any user, as any user, with or without root privileges.
  • Pressing the "New Login" button from xscreensaver-auth permanently locks username out of their session.


If ssh is available:
  1. Log in as the affected user via SSH
  2. Find the pid of the Xorg server for the affected user
  3. kill pid
If another username is available and can be safely locked out instead:
  1. Log in with the username to be locked out
  2. su to the affected user or gain applicable privileges
  3. Find the pid of the Xorg server for the affected user
  4. kill pid

The session will be lost, of course, but you can log in again without issue.

Actions #1

Updated by Daniel Bell about 1 year ago

edit: dm-tool does not use '--' before command names. My mistake.

Actions #2

Updated by Daniel Bell about 1 year ago

ConsoleKit 0.4.1 does not allow activation of sessions attached to "dynamic seats", according to this snippet in file ck-seat.c of the source code (line 229-240):

        /* for now, only support switching on static seat */
        if (seat->priv->kind != CK_SEAT_KIND_STATIC) {
                GError *error;
                error = g_error_new (CK_SEAT_ERROR,
                                     _("Activation is not supported for this kind of seat"));
                dbus_g_method_return_error (context, error);
                g_error_free (error);
                goto out;

This is causing the error messages in lightdm.log, and I assume also causing the bug. VTs are switched, hardware is redirected, etc. on receipt of the DBus ActivateSession signal for org.freedesktop.ConsoleKit.Seat, or the Activate signal on org.freedesktop.ConsoleKit.Session. If the seat is dynamic, then this error is returned through DBus and no redirection occurs.

I can't find anything in the documentation that describes the difference, but I assume dynamic seats are added at runtime and static seats are added through config files.

Actions #3

Updated by Daniel Bell about 1 year ago

Trivia for ConsoleKit:
  • All ConsoleKit seats created through DBus are assigned the type SEAT_TYPE_DYNAMIC.
    ck_manager_add_seat(...) in ck-manager.c, line 3223
    ck_manager_add_seat_by_id(...) in ck-manager.c, line 3250
  • All ConsoleKit seats created through config files are assigned SEAT_TYPE_STATIC.
    add_seat_for_file(...) in ck-manager.c -> ck_seat_new_from_file(...) in ck-seat.c, line 1898
And for lightdm:
  • lightdm seats are distinct from ConsoleKit seats.
  • All interactions between lightdm and ConsoleKit are via DBus.
  • When lightdm asks ConsoleKit to create a seat, it is guaranteed to be dynamic.

The dynamic seat functionality was added to ConsoleKit in some Solaris-included patches. It seems that this functionality was left incomplete at the time. It's possible to add support for activation (and VT switching) for dynamic seats, but it might not be worth the effort.

I've included a PR ( ) to disable user switching only for the default lightdm seat, which is made when no other seat is configured. This should leave any downstream configurations unaffected.


Also available in: Atom PDF