Configuration files: The /etc/inittab

This configuration file is read by the init daemon.
This daemon is called by the kernel and is responsible for bringing our system in a certain runlevel or change to another.


Runlevel explanation:

Think of a runlevel as a set of procedures that are followed in order to reach a certain operational state. The instructions are written in a high level language - script - and the usual runlevels instruct the OS to:

halt (turn off) the system
(runlevel 0)
goto single user (root) mode without network (runlevel 1)
goto multiuser with network without graphics (runlevel 3)
goto multiuser with network and graphics (runlevel 5)
reboot the system (runlevel 6)

Sometimes, there is a runlevel 2 (runlevel 1 plus network).
Sometimes, runlevel 4 is the runlevel 5.
These depend on distributions.

in runlevel 3, you can bring up the X Server + Desktop by typing:
startx
Do so if graphics card, keyboard and mouse are properly configured.
       
In runlevel 5, since the login procedure has not yet taken place, the login procedure is handled by the so-called Desktop Manager. Some Desktop Managers are:

xdm from the XFree86 package
kdm from the kde suite
gdm from the gnome suite.

Which of them operates by default, depends on the distribution.

Whether runlevel 5 or runlevel 3 operates by default, depends on the initial answers you gave to the distro wizard.



Now read the /etc/inittab file carefully: less /etc/inittab.

Default Runlevel:
You can change the default runlevel.
This task doesn't hurt your system at all.

id:3:initdefault:
or
id:5:initdefault:

Just edit the number, do not retype the line.
Don't use 0 or 6 as initdefault.


Number of Virtual Terminals:

You can change the number of ttys (consoles or Virtal Terminals) here.
I have added # to the beginning of 5th and 6th.

Even if you run your box in graphics mode using runlevel 5 as default, always leave at least one virtual terminal running.

The respawn tells init that if consoles are closed or killed,
they  have to be initialized again.
In the inittab you can also find:
The location of the control scripts.
The specified role of ctrl alt del.
What to do in a case of a power failure.

As root, you can change runlevels on the fly.
runlevel  show the current runlevel
N 3       (The result in my host)
su
       become a superuser, type the root password
telinit 1 Goto runlevel 1, login as root if needed.
telinit 3 Goto runlevel 3.
telinit 5 if you want to, or if it was your default.
       
In some cases, changing runlevel would do work like if
rebooting, since the kernel reruns everything.
If you want to break an uptime record, do so :))

More Info:

In /etc/inittab we can also see instructions for:

Serial terminals initialization
Dialup terminals "

power failure event
power failure cancellation event
ctrl-alt-del key press combination event.