Runlevels

The term "runlevel" in Unix is used to describe a set of predefined processes and services that are associated with a specific mode of Unix system operation. The processes associated with a certain runlevel are started by the /sbin/init process, as explained in the next section.

Most Linux systems, including SUSE Linux, provide multiple runlevels that you can use, numbered 0 through 6 and including runlevel s or S, which is shorthand for single-user mode and is equivalent to runlevel 1. Table 4-1 shows the general description of each runlevel.

TABLE 4-1

Runlevels and Their Descriptions

Runlevel

Description

0

This runlevel is used to halt a system. The machine is shut down, and all services are terminated.

1, s, S

Single-user mode. Only the root user is allowed to log in. No services are running.

2

Multiuser, no network. Users can log in only locally. No network services have been exported.

3

Multiuser, with network. The network has been initialized and any user can log in locally or over the network.

4

Unused. In principle definable, but this is rarely done; normally you will simply adjust either runlevel 3 or 5 to do what is needed.

5

Multiuser with X Windows and network. Same as runlevel 3, but the X Window system is loaded, allowing users to use a window manager — GNOME, KDE, and so on.

Reboot. This runlevel shuts down all services, the network, and so on, and reboots the machine.

Runlevels are an extremely important part of the Linux system, and any administrator must know how they work when managing a system. The administrator of a multiuser system must know how to take a system down to runlevel 1 in order to perform many administrative tasks without the possibility that other users can change data on the system. Runlevel 2 can be useful when trying to diagnose system problems that manifest themselves only in multiuser mode, but again without the possibility that other users could log in over the network and change data on the system. If you are your own system administrator for a home Linux system, you may want to set your system up to use runlevel 3 by default if you are experimenting with optimizing or upgrading your X Window system installation.

Was this article helpful?

0 0

Post a comment