GNOME Bugzilla – Bug 511168
Can't set the VT that GDM will use
Last modified: 2012-08-28 21:45:38 UTC
GDM 2.21.5 will always use the first free VT on Linux. This is problematic, because in practice this means VT 2 on boot. After GDM has grabbed this VT, mgetty kicks in according to inittab and clobbers the VT, resulting in a GDM prompt that won't respond to keyboard input. Typically you won't be able to kill the server, reset or switch VTs from the local console. The only recourse for most users is the reset switch. It would be nice to be able to set the first VT that GDM will use.
Created attachment 134497 [details] [review] Patch we use in openSUSE Hans Petter forgot to attach the patch, it seems ;-)
The patch doesn't exactly fix this bug; it scans for the first available VT starting with VT 7.
*** Bug 681340 has been marked as a duplicate of this bug. ***
I talked to DimStar about this and he said the kind of patch Lennart has done here should be fine for suse's needs. The following fix has been pushed: 42ef43e gdm: always run gdm on VT1
Created attachment 220506 [details] [review] gdm: always run gdm on VT1 This drops automatic VT allocation schemes for the initial display in favour of a compile time hardcoded VT assignment. The automatic allocation schemes are inherently racy since a simpler output to the console might already influence it and result in gdm running on another than the intended VT. This patch adds a --with-initial-vt= switch to configure which may be used to set the VT gdm will run the initial server on. It defaults to 1. https://fedoraproject.org/wiki/Features/DisplayManagerRework
Hmm, there is a small bug in the commited patch: + if (server->priv->is_initial + && g_strcmp0 (server->priv->display_seat_id, "seat0") == 0) { + vtarg = "vt" GDM_INITIAL_VT; + } On non-systemd systems (where multi-seat is not available) the display_seat_id will be NULL and hence the VT setting will not have any effect. My original patch did this instead: + /* Hardcode the VT for the initial X server, but nothing else */ + if (server->priv->is_initial && + (server->priv->display_seat_id == NULL || + strcmp (server->priv->display_seat_id, "seat0") == 0)) + vtarg = "vt" GDM_INITIAL_VT; i.e. will set the VT if the field is either NULL or "seat0" which makes all the difference. Thanks for commiting this so quickly!
. o O ( have these people ever heard of several local DMs running along?.. )
The following fix has been pushed: 9c727fb server: fix non-systemd code path
Created attachment 222574 [details] [review] server: fix non-systemd code path I incorrectly used g_strcmp0 in commit 42ef43e603d65390c2c86e276489c8a08c7808a0 breaking consolekit users. This commit rectifies that.
There is still a minor issue with gdm on ubuntu, always fails on first restart of gdm with "Server is already active for display 0". Works on a second restart however. That didnt happen when vtargs was NULL on gdm_server_spawn(). I think the hacky debian/ubuntu patch that was dropped for 3.5.90, used a timestamp to only hardcode the VT on the initial startup.
do you have attachment 222574 [details] [review] in the build?
Yes. Although actually I think its not a gdm bug, since I can reproduce it with lightdm also.