Human Readable   

 

     
   
     

A Slackware Desktop Enhancement Guide

Configuring Slackware for a GUI Startup—Part II

© Copyright Darrell Anderson.

Although not related to configuring Slackware for a GUI login, while editing the inittab configuration file one might consider a simple tweak that will conserve some system memory and resources. This tweak helps people running Slackware on older hardware or with limited RAM.

By default the Slackware inittab establishes six consoles or virtual terminals. These terminals often are referred to with the acronym tty, which is derived from years ago when terminals were teletype machines. Kerchunka!

Unlike a mainframe environment where many actual terminals (keyboards) are connected to one computer, with a modern single desktop computer typically only one keyboard is attached. However, all ‘nix systems are multi-user by design. Thus, virtual terminals are used, that is, different terminal sessions such that users simulate working from a different terminal or keyboard.

After performing the previous modification to boot into runlevel 4, scroll down the inittab file to a section that looks like this:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
c4:1235:respawn:/sbin/agetty 38400 tty4 linux
c5:1235:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux

Each line instructs the init command to establish a console or virtual terminal session. After booting into Slackware and the text-based login screen appears, a user can toggle to any of these six consoles using a standardized keyboard shortcut of Alt-Fn, where Fn represents a function key and the n represents a respective console number. Thus, Alt-F1 is the keyboard shortcut to toggle to console 1 (tty1), Alt-F2 for console 2 (tty2), etc., all the way through Alt-F6 for console 6 (tty6). One does not have to be logged in to toggle among these six consoles.

However, these inittab instructions are of interest to people who want to modify their Slackware to automatically boot into runlevel 4 and a GUI login manager. Notice those sequential numbers just after the console identifier (c1, c2, c3, etc.). Those sequential numbers represent runlevels. That is, those numbers represent the runlevels in which the console or virtual terminal is enabled and available. Notice that by default Slackware provides only one console when operating in runlevel 4. In runlevel 4 all but tty6 is disabled in runlevel 4. Only tty6 is available. This configuration explains why, when new users boot into runlevel 4, and after they discover how to use the Alt-Fn keyboard shortcuts, that they cannot see any consoles but the one available when they press Alt-F6. The computer is responding exactly as instructed.

Although some users actually use six consoles, many typical users working with a single desktop computer seldom use more than two or three consoles. Therefore, the additional consoles are unnecessary and the memory resources assigned to those consoles can be released for other purposes. All that is necessary is to add a hash mark (#) in front of each console line that is deemed unnecessary. (In many ‘nix configuration files a hash mark converts a line from an instruction to a comment.) For example, to use only three consoles or virtual terminals, comment out the last three lines like so:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
#c4:1235:respawn:/sbin/agetty 38400 tty4 linux
#c5:1235:respawn:/sbin/agetty 38400 tty5 linux
#c6:12345:respawn:/sbin/agetty 38400 tty6 linux

This tweak is merely one of those small things that can help people with computers containing nominal amounts of RAM. However, continuing reading if deciding to modify the inittab in this manner.

Caveat—Ensuring Consoles are Available in Runlevel 4

As previously mentioned, the default Slackware configuration provides only one command line console when running in runlevel 4. After modifying the inittab to boot into runlevel 4, and perhaps modifying the configuration file to disable some unnecessary consoles or virtual terminals, a user might discover that no command line consoles are available at all when operating in runlevel 4. The reason is that at least one of the remaining inittab lines establishing console sessions must be modified to provide for a console in runlevel 4.

In the previous example, tty4, tty5, and tty6 were disabled. With the original default configuration, the remaining three consoles would be available only in runlevels 1, 2, 3, and 5 but never in runlevel 4. The trick then is to modify at least one console session:

c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:12345:respawn:/sbin/agetty 38400 tty3 linux

Notice that tty3 now provides a command line console when operating in runlevel 4.

Finis.

Table of Contents