LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-14-2009, 10:02 AM   #1
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Determining Virtual Terminal for Xorg


With the introduction of upstart back in Fedora 9 we had a change in position of X getting started on tty1 rather than the age old tty7. I don't want to get into a discussion of the pros and cons of that change. Rather I'd like to better understand how the tty gets assigned. From what I can tell from the documentation, or lack thereof, it is based on start order and X gets assigned the first available tty. Is this a true statement? If so, how does it get assigned if a regular user does a logout and gdm\X get respawned?

The reason I ask is that I'm experiencing a switch from tty1 to tty7 after I logout of Gnome in Fedora 11 and Rawhide. Fedora 10 does not have this problem, it stays put on tty1. I've filed Bug 528867 to address this, however, I'd like to know if anyone else is experiencing this besides me and what others know about tty assignment.

----
Bill

Last edited by wmakowski; 10-15-2009 at 12:16 AM.
 
Old 10-14-2009, 08:49 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
See man on the /etc/inittab file.

For examples start here.

http://www.linuxquestions.org/questi...roblem-234721/
 
Old 10-15-2009, 12:16 AM   #3
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Original Poster
Rep: Reputation: 56
Thanks for the reply, but that post is quite old and not what I was looking for. The configuration of tty's has not been done in inittab since Fedora 9. In fact there is no longer a man page for inittab.

A typical initab now looks like what I posted below. The first line in inittab tells us that it only sets the default runlevel and everything else is taken care of by events in upstart. Line 11 gives us a clue where to look for tty configuration, but there are no indications of how they get assigned to function keys. My best guess so far is that it has to do with the order of execution and the next available function key. So if prefdm is run first it will get F1. F2-F6 get assigned mingettys.

Code:
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/event.d/rcS
#
# Individual runlevels are started by /etc/event.d/rc[0-6]
#
# Ctrl-Alt-Delete is handled by /etc/event.d/control-alt-delete
#
# Terminal gettys (tty[1-6]) are handled by /etc/event.d/tty[1-6] and
# /etc/event.d/serial
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(8), initctl(8), and events(5).
#
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
# 
id:5:initdefault:
----
Bill

Last edited by wmakowski; 10-15-2009 at 12:35 AM.
 
Old 10-15-2009, 10:30 AM   #4
Homer Jay
LQ Newbie
 
Registered: Dec 2003
Location: Berlin/Germany
Distribution: Debian
Posts: 22

Rep: Reputation: 15
Without any config-options tellig it otherwise, X picks the first free VT.
The number of VTs for login is usually given in inittab like so

Code:
# Format:
#  <id>:<runlevels>:<action>:<process>
1:12345:respawn:/sbin/getty 38400 tty1
2:2345:respawn:/sbin/getty 38400 tty2
3:2345:respawn:/sbin/getty 38400 tty3
4:2345:respawn:/sbin/getty 38400 tty4
5:2345:respawn:/sbin/getty 38400 tty5
6:2345:respawn:/sbin/getty 38400 tty6
In your case, things seem a bit different...
But anyway, you can always command X which VT it should use.

Code:
X -help
gives you

Code:
vtXX                   use the specified VT number
near the bottom. Thus, also

Code:
startx -- vt8
should work. Now, to get that in some config-file requires a bit
of research... On my Debian box, i have

Code:
:0 local /usr/bin/X :0 vt9
:1 local /usr/bin/X :1 vt10
in /etc/X11/kdm/Xservers. I'm sure gdm also has a way to configure
the x-server(s).

hth
 
Old 10-15-2009, 11:44 AM   #5
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Original Poster
Rep: Reputation: 56
Thank you Homer Jay, your post answered a few questions and gave me a few new places to look. I can see now that it is at least possible to assign a vt# for the session. It was also helpful to verify my assumption that it will take the first available vt if it has not been assigned.

Yes, things are a bit different now with inittab and the use of upstart. It seems Ubuntu and Fedora have taken this route and will diverge even further from the traditional sysvinit way of doing things. There are also a number of changes with the way gdm has developed making this quite a learning experience.

----
Bill
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Killing the process on a virtual terminal from another virtual terminal. Azazwa Linux - Newbie 8 05-05-2009 12:33 PM
xorg - virtual resolution setkos Linux - Laptop and Netbook 4 03-01-2009 07:37 PM
uk keymap for Xorg.ccnf doesn't allow virtual terminal switching... Oholiab Linux - General 1 01-13-2006 08:37 AM
Determining the Active Virtual Console MasterPi Linux - General 5 05-02-2005 11:11 PM
xorg virtual screen sharkee Mandriva 3 11-27-2004 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration