0% found this document useful (0 votes)
261 views8 pages

Booted Into: Unix-Like Operating System

Runlevels in Linux designate preset operating states represented by integers from 0-6. Each runlevel configures different system resources and processes. Linux typically boots to runlevel 3 for servers without a GUI or runlevel 5 for desktops with a GUI. The telinit command or modifying /etc/inittab can change the runlevel, for example to troubleshoot graphical issues by temporarily booting to a console-only runlevel.

Uploaded by

Dinesh Rathore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
261 views8 pages

Booted Into: Unix-Like Operating System

Runlevels in Linux designate preset operating states represented by integers from 0-6. Each runlevel configures different system resources and processes. Linux typically boots to runlevel 3 for servers without a GUI or runlevel 5 for desktops with a GUI. The telinit command or modifying /etc/inittab can change the runlevel, for example to troubleshoot graphical issues by temporarily booting to a console-only runlevel.

Uploaded by

Dinesh Rathore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

RUN LEVELS in LINUX

Arunlevelis a preset operating state on


aUnix-likeoperating system.
A
system
can
bebooted into(i.e.,
started up into) any of several runlevels,
each of which is represented by a single
digit integer. Each runlevel designates a
different system configuration and
allows access to a different combination
of processes(i.e.,instancesof executing
programs).

Seven runlevels are supported in the standardLinux


kernel(i.e., core of the operating system). They
are:
0 - System halt; no activity, the system can be
safely powered down.
1 - Single user; rarely used.
2 - Multiple users, no NFS (networkfilesystem); also
used rarely.
3 - Multiple users,command line(i.e., all-text
mode)interface; the standard runlevel for most
Linux-basedserverhardware.
4 - User-definable
5 - Multiple users,GUI(graphical user interface); the
standard runlevel for most Linux-based desktop
systems.
6 -Reboot; used when restarting the system.

By default Linux boots either to


runlevel 3 or to runlevel 5. The
former permits the system to run all
services except for a GUI. The latter
allows all services including a GUI.

In addition to the standard runlevels, users


can modify the preset runlevels or even
create new ones if desired. Runlevels 2 and
4 are usually used for user defined
runlevels.
The program responsible for altering the
runlevel isinit, and it can be called using
thetelinitcommand. For example, changing
from runlevel 3 to runlevel 5, which allows
the GUI to be started, can be accomplished
by theroot(i.e., administrative) user by
issuing the following command:
telinit 5

Booting into a different runlevel can help


solve certain problems. For example, if a
change made in theX Window System
configuration on a machine that has
been set up to boot into a GUI has
rendered the system unusable, it is
possible to temporarily boot into a
console(i.e., all-text mode) runlevel (i.e.,
runlevels 3 or 1) in order to repair the
error and then reboot into the GUI. The X
Window System is a widely used system
for managing GUIs on singlecomputers
and onnetworksof computers

Likewise, if a machine will not boot due


to a damaged configurationfileor will
not allowlogging inbecause of a
corrupted/etc/passwdfile (which stores
user names and otherdataabout users)
or because of a forgotten password, the
problem can solved by first booting into
single-user mode (i.e. runlevel 1).
Therunlevel commandcan be used to
find both the current runlevel and the
previous runlevel by merely typing the
following and pressing the Enter key:
/sbin/runlevel

The runlevelexecutable file(i.e., the ready-torun form of the program) is typically located in
the/sbindirectory, which contains mostly
administrative tools and which by default is not
in the user'sPATH(i.e., the list of directories in
which the system searches for programs). Thus,
it is usually necessary to type thefull pathof
the command as shown above rather than just
the name of the command itself.
The default runlevel for a system is specified in
the/etc/inittabfile, which will contain an entry
such asid:3:initdefault:if the system starts in
runlevel 3, orid:5:initdefault:if it starts in
runlevel 5. This file can be easily (and safely)
read with a command such ascat, i.e.,
cat /etc/inittab

As an alternative to telinit, the


runlevel into which the system boots
can be changed by modifying
/etc/inittab manually with atext
editor. However, it is generally easier
and safer (i.e., less chance of
accidental damage to the file) to use
telinit. It is always wise to make a
backup copy of /etc/inittab or any
other configuration file before
attempting to modify it manually.

You might also like