Runlevels are different states of your machine.
For instance, your machine boots up in a specific runlevel, shuts down in another one, etc.
ie runlevel 0 is for halt, 6 for reboot and 1 for "single user mode".
The other runlevels are not reserved, as far as I know, but are all used for different multi-user modes.
However, when the system enters/exits a runlevel, it executes certain scripts (typically in /etc/rc.d or something like that). These scripts are used, for instance, to automatically start services (like vsftd, httpd, etc) when you enter certain runlevels in a fixed order.
So, different runlevels mean different programs running in the background (different services).
This makes it possible to define, for instance, a multi-user mode where you don't have any networking, where certain devices or services are disabled, etc.
Typically, runlevel 3 is used for a non-graphical mode and 5 for a heavier, graphical mode.
But you can easily customize these multi-user runlevels to suit your needs, or define your own.
Of course, you can run any program (or executable), like startx, from whatever single or multi-user runlevel you are in, but the "environment" may be different in the sense that some services may not have been started automatically. Because of this, the program you are starting may fail or may not behave exactly as you want.
Check out "man init" for details on runlevels, "man chkconfig" for configuring services to start services in certain runlevels.
Use "telinit" to change runlevel.
|