Description: Force initial X server to go to tty7 instead of tty1. This is an Ugly Hack until we have a cleaner solution for getty not to tramp over a running X server on vt1. Author: Martin Pitt Bug-Ubuntu: https://launchpad.net/bugs/396226 diff -Nur -x '*.orig' -x '*~' gdm-2.29.6/daemon/gdm-server.c gdm-2.29.6.new/daemon/gdm-server.c --- gdm-2.29.6/daemon/gdm-server.c 2010-03-03 11:52:53.918213893 +0100 +++ gdm-2.29.6.new/daemon/gdm-server.c 2010-03-03 11:56:41.047541846 +0100 @@ -630,6 +630,13 @@ g_debug ("GdmServer: Starting X server process: %s", freeme); g_free (freeme); + /* write a stamp file, so that the first startup of the server can be + * special-cased (initial server needs to go on vt7, since 1 to 6 + * usually get gettys after gdm startup, which interfere with X) */ + int f = open ("/var/run/gdm/firstserver.stamp", O_CREAT|O_WRONLY|O_EXCL, 0666); + if (f >= 0) + close (f); + error = NULL; ret = g_spawn_async_with_pipes (NULL, argv, @@ -674,9 +681,14 @@ gdm_server_start (GdmServer *server) { gboolean res; + int firstserver; + + /* HACK: force initial server to go on vt7, since 1 to 6 usually get + * gettys after gdm startup, which interfere with X */ + firstserver = access ("/var/run/gdm/firstserver.stamp", F_OK) < 0; /* fork X server process */ - res = gdm_server_spawn (server, NULL); + res = gdm_server_spawn (server, firstserver ? "vt7" : NULL); return res; }