Bug #11694

Does not switch to the Desktop VT after login on Stretch

Added by intrigeri 2016-08-23 05:00:52 . Updated 2020-04-15 06:02:00 .

Status:
Resolved
Priority:
High
Assignee:
intrigeri
Category:
Target version:
Start date:
2016-08-23
Due date:
% Done:

100%

Feature Branch:
bugfix/11694-fix-vt-switch
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Welcome Screen
Deliverable for:

Description

Once I click “Login” X disappears and I’m back on a text console. But then I can reach the GNOME session with CTRL+ALT+F2.


Files


Subtasks


Related issues

Related to Tails - Bug #11705: Make Greeter a bit more compatible with Stretch Resolved 2016-08-24

History

#1 Updated by intrigeri 2016-08-24 05:29:04

  • Xorg for the amnesia user’s session is only started when one switches to vt2.
  • Things behave just the same on feature/stretch + the new Greeter, so it seems that we cannot blame the fact that we’re using Metacity and GNOME Flashback instead of GNOME Shell.
  • Running chvt 2 at the end of PostLogin/Default does not work. And even if it did, the resulting UX would be crappy.
  • On Debian, after login, GDM’s GNOME session is still running on vt1. But on Tails it has vanished. It seems that the Greeter dies immediately after calling call_start_session_when_ready_sync (“start_session_when_ready_sync called” is never logged). The Greeter dies even if we disable self.session_opened_cb, that calls close_app, that calls Gtk.main_quit. And quickly after the Greeter has died, I see this error message: gdm3[2826]: (gdm-display.c:1141):gdm_display_dispose: runtime check failed: (self->priv->status != GDM_DISPLAY_MANAGED) (source code. I don’t know if that’s a cause or a consequence of Xorg and the GNOME session dying under our Greeter’s feet.
  • I’ve compared the code path with GNOME Shell’s and spotted no big differences.
  • I’ve updated some code in a way that should stay compatible with Jessie, and be more compatible with Stretch. I’ll track this on another ticket.
  • anonym added a workaround in the test suite (that does chvt 2 at the right time) so this does not block anything at the moment, except testing by people who would not read known issues, which is not relevant yet.

#2 Updated by intrigeri 2016-08-24 05:30:50

  • related to Bug #11705: Make Greeter a bit more compatible with Stretch added

#3 Updated by intrigeri 2016-08-24 05:39:34

I’ll put this on hold at least for a couple days, and possibly until Alan can help me.

#4 Updated by intrigeri 2016-08-24 10:15:01

Next things to (re-)try with 0.8.24+:

  • fix Bug #11695 to have usable debugging output (and who knows, it might have something to do with the problem at hand)
  • hard-code s/user_name/"amnesia"/ when calling call_begin_auto_login_sync in __on_verification_complete
  • disable session_opened_cb

#5 Updated by intrigeri 2016-08-25 01:44:15

See explanation about the VT switch on https://sources.debian.net/src/gdm3/3.20.1-1/daemon/gdm-session.c/#L3105.

#6 Updated by anonym 2016-08-25 08:05:21

I’m working around this in the automated test suite with commit:3c9df01ddfda63440205c32f05dea46d60bb9567.

#7 Updated by intrigeri 2016-08-26 07:16:23

After replacing the undefined user_name with "amnesia" in __on_verification_complete, and bumping __on_problem’s debugging level to warning:

Aug 26 14:13:51 amnesia tails-greeter.desktop[32051]: [INFO] tails-greeter.py:127 usermanager_loaded: tails-greeter is ready.
Aug 26 14:13:51 amnesia /usr/lib/gdm3/gdm-x-session[31999]: error doing QXL_UPDATE_AREA -1 22 0
Aug 26 14:13:51 amnesia tails-greeter.desktop[32051]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Aug 26 14:13:51 amnesia /usr/lib/gdm3/gdm-x-session[31999]: error doing QXL_UPDATE_AREA -1 22 0
Aug 26 14:13:58 amnesia gdm3[31957]: GLib-GIO: g_dbus_method_invocation_return_gerror: assertion 'G_IS_DBUS_METHOD_INVOCATION (invocation)' failed
Aug 26 14:13:58 amnesia tails-greeter.desktop[32051]: [WARNING] gdmclient.py:59 __on_problem: Received problem Cannot process state change to SETUP_COMPLETE, as there is already an outstanding request to move to state SESSION_OPENED from gdm-autologin
Aug 26 14:13:58 amnesia tails-greeter.desktop[32051]: Traceback (most recent call last):
Aug 26 14:13:58 amnesia tails-greeter.desktop[32051]:   File "/usr/lib/python2.7/dist-packages/tailsgreeter/gdmclient.py", line 60, in __on_problem
Aug 26 14:13:58 amnesia tails-greeter.desktop[32051]:     raise tailsgreeter.errors.GdmServerError
Aug 26 14:13:58 amnesia tails-greeter.desktop[32051]: tailsgreeter.errors.GdmServerError

If we avoid calling call_begin_auto_login_sync, then this error disappears, and the login process works just as well (and just as bad), i.e. the greeter’s GNOME session dies and:

Aug 26 14:32:11 amnesia tails-greeter.desktop[3416]: [WARNING] gdmclient.py:80 __on_session_opened: Received session opened with gdm-autologin
Aug 26 14:32:11 amnesia gdm-x-session[3365]: GLib-GIO: g_task_return_boolean: assertion 'task->result_set == FALSE' failed
Aug 26 14:32:11 amnesia gdm-x-session[3365]: GLib-GObject: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

And then if we avoid calling call_start_session_when_ready_sync then the greeter’s GNOME session does not die, but the VT switch still does not happen.

#8 Updated by intrigeri 2016-08-27 00:32:49

Worth trying:

  • enable GDM debug logging
  • make gnome-session more verbose, by passing it --debug in the relevant .desktop file (possibly in /usr/share/xsessions/gnome.desktop)
  • check how live-config’s noautologin plays with all that
  • check the greeter’s signal handling, e.g. the PAUSE one

#9 Updated by spriver 2016-10-04 22:01:01

With an iso from last week the GNOME desktop now appears after logging in at the greeter.

I don’t know if anything was done a this side in the meantime so that it’s working now…

#10 Updated by intrigeri 2016-10-04 22:28:02

> With an iso from last week the GNOME desktop now appears after logging in at the greeter.

> I don’t know if anything was done a this side in the meantime so that it’s working now…

What’s the ISO filename (assuming you downloaded it from nightly.t.b.o)?

#11 Updated by spriver 2016-10-05 06:20:52

The filename is just latest.iso as usually at nightly.t.b.o

I just retried with an iso from yesterday with this tails-about output:

Build information:
3.0 - 20161004
56c81e5eccf893a4cafccbb63ce1924c7a5cec52
live-build: 3.0.5+really+is+2.0.12-0.tails2
live-boot: 1:20160511
live-config: 5.20160608

In VirtualBox:
The GNOME desktop is still appearing after booting, it takes some seconds where the screen is black (but I assume that this is because the Greeters’ background is black).

On bare-metal:
The behavior similar to the one in this tickets’ description happens (Tails does not switch to the Desktops’ VT)

#12 Updated by intrigeri 2016-10-05 07:05:40

> The filename is just latest.iso as usually at nightly.t.b.o

Right. Note that these (found in http://nightly.tails.boum.org/build_Tails_ISO_feature-stretch/lastSuccessful/archive/) are symlinks to files in http://nightly.tails.boum.org/build_Tails_ISO_feature-stretch/lastSuccessful/archive/build-artifacts/, that have more useful filenames. I’ll try to remember to point to the latter location in the future :)

> I just retried with an iso from yesterday with this tails-about output: […]

> In VirtualBox: The GNOME desktop is still appearing after booting, it takes some seconds where the screen is black (but I assume that this is because the Greeters’ background is black).

This is very interesting, thanks! I’ll try to reproduce during next Stretch sprint. Can you please attach (or email me as attachment) the output of sudo journalctl -al from that Tails system after logging in?

> On bare-metal: The behavior similar to the one in this tickets’ description happens (Tails does not switch to the Desktops’ VT)

OK. That’s what I see on libvirt/QEMU. I don’t remember trying on bare metal myself.

#13 Updated by spriver 2016-10-05 10:06:02

intrigeri wrote:
> > The filename is just latest.iso as usually at nightly.t.b.o
>
> Right. Note that these (found in http://nightly.tails.boum.org/build_Tails_ISO_feature-stretch/lastSuccessful/archive/) are symlinks to files in http://nightly.tails.boum.org/build_Tails_ISO_feature-stretch/lastSuccessful/archive/build-artifacts/, that have more useful filenames. I’ll try to remember to point to the latter location in the future :)

Good to know,thanks for the hint! (:
>
> > I just retried with an iso from yesterday with this tails-about output: […]
>
> > In VirtualBox: The GNOME desktop is still appearing after booting, it takes some seconds where the screen is black (but I assume that this is because the Greeters’ background is black).
>
> This is very interesting, thanks! I’ll try to reproduce during next Stretch sprint. Can you please attach (or email me as attachment) the output of sudo journalctl -al from that Tails system after logging in?

I attached the output in a file. Feel free to ask for more tests (:

#14 Updated by alant 2016-11-15 12:27:56

First, I monitord the system bus (see https://wiki.ubuntu.com/DebuggingDBus), but it turned out to show nothing interesting.

Then I went through gdm’s logs (in daemon.conf: [debug] Enable=true) and it actually tries to change VT:

Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: start program: /usr/lib/gdm3/gdm-x-session --run-script  "default"
Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: attempting to change state to SESSION_STARTED
Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: opening user session with program '/usr/lib/gdm3/gdm-x-session'
Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: jumping to VT 4
Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: first setting graphics mode to prevent flicker
Nov 15 12:06:15 amnesia gdm-autologin][8195]: GdmSessionWorker: VT mode did not need to be fixed

#15 Updated by alant 2016-11-15 15:11:37

  • Assignee changed from intrigeri to alant
  • % Done changed from 0 to 20

I tried to boot the stock greeter in Tails by commenting [org/gnome/desktop/session] session-name='gdm-tails' in /usr/share/gdm/dconf/50-tails and the VT switch works.

I tried to start the stock greeter in Tails with WaylandEnable=false in /etc/gdm/daemon.conf and the VT switch works

I tried WaylandEnable=false in /etc/gdm/daemon.conf with Tails Greeter and the VT switch doesn’t work.

I tried to speak to gdm-password instead of gdm-autologin in Tails Greeter (hardcoding a password) and the VT switch works!

#16 Updated by alant 2016-11-15 15:59:19

Things like that in gdm-manager.c explains that what we tried to do can’t work:

<code class="c">
                if (g_strcmp0 (operation->service_name, "gdm-autologin") == 0) {
                        /* remove the unused prepared greeter display since we're not going
                         * to have a greeter */
                        gdm_display_store_remove (self->priv->display_store, display);
                        g_object_unref (display);
                }

                /* Give the user session a new display object for bookkeeping purposes */
                session_id = gdm_session_get_conversation_session_id (operation->session,
                                                                      operation->service_name);
                create_display_for_user_session (operation->manager,
                                                 operation->session,
                                                 session_id);

</code>

Basically, if we talk to gdm-autologin, GDM assumes there is no display to manage.

A solution is to talk to gdm-password, and to add to /etc/pam.d/gdm-password:

auth    sufficient                      pam_succeed_if.so user = amnesia

#17 Updated by alant 2016-11-15 17:27:26

  • % Done changed from 20 to 50
  • Feature Branch set to bugfix/11694-fix-vt-switch

I implemented a pure password-based login in greeter:bugfix/11694-fix-vt-switch.

#18 Updated by alant 2016-11-15 17:43:57

I also built a package and created a tails branch bugfix/11694-fix-vt-switch.

#19 Updated by alant 2016-11-15 21:02:11

  • QA Check set to Ready for QA

The feature/stretch ISO including this fix actually fixes the issue. I can’t test wether it also works under devel as it’s not buildable.

#20 Updated by intrigeri 2016-11-16 10:03:20

  • Status changed from Confirmed to In Progress
  • Assignee changed from alant to intrigeri

#21 Updated by intrigeri 2016-11-16 10:09:02

  • % Done changed from 50 to 60

Code review passes, looks OK during brief manual testing on Jessie. I’ll merge into feature/stretch but will wait for automated tests results (https://jenkins.tails.boum.org/view/Tails_ISO/job/test_Tails_ISO_bugfix-11694-fix-vt-switch/) before I merge into devel.

#22 Updated by intrigeri 2016-11-16 15:44:27

  • Status changed from In Progress to Resolved
  • % Done changed from 60 to 100

Applied in changeset commit:85d217d01d9850c85f081976734bf816851d4ed7.

#23 Updated by intrigeri 2018-04-08 16:47:25

  • QA Check deleted (Ready for QA)

#24 Updated by intrigeri 2020-04-15 06:02:00

  • Affected tool changed from Greeter to Welcome Screen