[pkg-fso-maint] Bug#504842: nodm: default X11 console should be vt7

Enrico Zini enrico at enricozini.org
Mon Jul 6 09:06:39 UTC 2009


On Mon, Jul 06, 2009 at 01:00:11AM +0200, Enrico Zini wrote:
> On Fri, Nov 07, 2008 at 05:21:14PM +0100, Luca Capello wrote:
> 
> > This is a known problem and nodm should be adjusted to the default in
> > Debian, i.e. it should check for the first unused vt starting from the
> > seventh one [2].
> 
> I'll try and do it. If in the meantime you have pointers to some code to
> check if a vt is unused, that'd be great, otherwise I'll try to dig it
> out of gdm.

The relevant gdm code seems to be in daemon/getvt.c, functions
get_free_vt_sys and get_free_vt_consio, wrapped by
gdm_get_empty_vt_argument. The difference between the two
implementations depends on the operating system:

	/* Virtual terminals only supported on Linux, FreeBSD, DragonFly, or
	 * Solaris */
	#if defined (__linux__) || defined (__sun)
	 /* Must check HAVE_SYS_VT since older Solaris doesn't support this. */
	#ifdef HAVE_SYS_VT_H
	#define GDM_USE_SYS_VT
	#endif
	#endif

	#if defined (__FreeBSD__) || defined (__DragonFly__)
	#define GDM_USE_CONSIO_VT
	#endif

They do some magic (the code has a number of #ifdefs to handle several
OS differences) and then return a vt number and a file descriptor open
to the vt. Then the server is started, and after the server has taken
the vt, the file descriptor is closed.

I could open the vt in the parent process then close it in the session
process; since the session process is called by xinit, to do so I need
to leave the fd open for the child process and pass its number to the
session process in an env var. That is doable.

It is still unclear to me what to do if none of the two methods of
allocating a vt are found.


Ciao,

Enrico

-- 
GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <enrico at enricozini.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-fso-maint/attachments/20090706/9929eb69/attachment.pgp>


More information about the pkg-fso-maint mailing list