Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, I just did a fresh install of the CentOS 5.1 and would like to limit the number of consoles (Ctrl-Alt-F1, Ctrl-Alt-F2, etc) to only have 4 character consoles and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2004
    Location
    Seattle, WA
    Posts
    42

    Changing number of consoles available


    Hello,

    I just did a fresh install of the CentOS 5.1 and would like to limit the number of consoles (Ctrl-Alt-F1, Ctrl-Alt-F2, etc) to only have 4 character consoles and 1 GUI screen. I would like the Ctrl-Alt-F5 screen to be the GUI screen. I've changed the /etc/inittab to be the following:

    Code:
    #
    # inittab       This file describes how the INIT process should set up
    #               the system in a certain run-level.
    #
    # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
    #               Modified for RHS Linux by Marc Ewing and Donnie Barnes
    #
    
    # Default runlevel. The runlevels used by RHS 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:
    
    # System initialization.
    si::sysinit:/etc/rc.d/rc.sysinit
    
    l0:0:wait:/etc/rc.d/rc 0
    l1:1:wait:/etc/rc.d/rc 1
    l2:2:wait:/etc/rc.d/rc 2
    l3:3:wait:/etc/rc.d/rc 3
    l4:4:wait:/etc/rc.d/rc 4
    l5:5:wait:/etc/rc.d/rc 5
    l6:6:wait:/etc/rc.d/rc 6
    
    # Trap CTRL-ALT-DELETE
    #ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    
    # When our UPS tells us power has failed, assume we have a few minutes
    # of power left.  Schedule a shutdown for 2 minutes from now.
    # This does, of course, assume you have powerd installed and your
    # UPS connected and working correctly.
    pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
    
    # If power was restored before the shutdown kicked in, cancel it.
    pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
    
    
    # Run gettys in standard runlevels
    1:2345:respawn:/sbin/mingetty tty1
    2:2345:respawn:/sbin/mingetty tty2
    3:2345:respawn:/sbin/mingetty tty3
    4:2345:respawn:/sbin/mingetty tty4
    5:2345:off:/sbin/mingetty tty5
    6:2345:off:/sbin/mingetty tty6
    
    # Run xdm in runlevel 5
    x:5:respawn:/etc/X11/prefdm -nodaemon
    Right now the F5 and F6 just have a blinking cursor. I've tried googling this, but haven't found anything.

    Any help is appreciated.

    Thanks,
    Jared

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Have you tried just commenting out the lines for tty5 and tty6?

  3. #3
    Just Joined!
    Join Date
    Aug 2004
    Location
    Seattle, WA
    Posts
    42
    Quote Originally Posted by daark.child View Post
    Have you tried just commenting out the lines for tty5 and tty6?
    Yes, I have commented them out and got the same result.

  4. #4
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Hi, You need to comment out the tty and rc.d lines on my system to restrict number of consoles.

  5. #5
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Hi again, the console used by X is the next available in the list in the inittab file - which on most systems is tty7. I have moved mine to tty9 by copy an rc6.d file including contents and renaming them rc7.d and rc8.d. Edit inittab to include lines for the rc.d entries and tty entries with the appropriate number.
    see below:
    l0:0:wait:/etc/rc.d/rc 0
    l1:1:wait:/etc/rc.d/rc 1
    l2:2:wait:/etc/rc.d/rc 2
    l3:3:wait:/etc/rc.d/rc 3
    l4:4:wait:/etc/rc.d/rc 4
    l5:5:wait:/etc/rc.d/rc 5
    l6:6:wait:/etc/rc.d/rc 6
    l7:7:wait:/etc/rc.d/rc 7
    l8:8:wait:/etc/rc.d/rc 8

    # Trap CTRL-ALT-DELETE
    ca::ctrlaltdel:/sbin/shutdown -t3 -r now

    # When our UPS tells us power has failed, assume we have a few minutes
    # of power left. Schedule a shutdown for 2 minutes from now.
    # This does, of course, assume you have powerd installed and your
    # UPS connected and working correctly.
    pf:owerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

    # If power was restored before the shutdown kicked in, cancel it.
    pr:12345owerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


    # Run gettys in standard runlevels
    1:2345:respawn:/sbin/mingetty tty1
    2:2345:respawn:/sbin/mingetty tty2
    3:2345:respawn:/sbin/mingetty tty3
    4:2345:respawn:/sbin/mingetty tty4
    5:2345:respawn:/sbin/mingetty tty5
    6:2345:respawn:/sbin/mingetty tty6
    7:2345:respawn:/sbin/mingetty tty7
    8:2345:respawn:/sbin/mingetty tty8

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Comment out mingetty lines only. I have disabled tty2, 3 and 4 in Fedora Box with similar method.
    Code:
    # Run gettys in standard runlevels
    1:2345:respawn:/sbin/mingetty tty1
    #2:2345:respawn:/sbin/mingetty tty2
    #3:2345:respawn:/sbin/mingetty tty3
    #4:2345:respawn:/sbin/mingetty tty4
    5:2345:respawn:/sbin/mingetty tty5
    6:2345:respawn:/sbin/mingetty tty6
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Aug 2004
    Location
    Seattle, WA
    Posts
    42
    I ended up doing this:

    Edited /usr/share/gdm/defaults.conf
    Change the entry under [servers]
    From
    0=Standard
    To
    0=Standard vt5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •