Runlevel

From Wikipedia, the free encyclopedia

The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six.

In standard practice, when a computer enters runlevel zero, it halts, and when it enters runlevel six, it reboots. The intermediate runlevels (1-5) differ in terms of which drives are mounted, and which network services are started. Lower run levels are useful for maintenance or emergency repairs, since they usually don't offer any network services at all. The particular details of runlevel configuration differ widely among operating systems, and slightly among system administrators.

The runlevel system replaced the traditional /etc/rc script used in Version 7 Unix.

Contents

Standard runlevels
ID Name Description
0 Halt Halts—or shuts down—the system.
S Single-User Mode Does not configure network interfaces or start daemons.[1]
6 Reboot Reboots the system.

[1] = Almost all systems use runlevel 1 for this purpose. This mode is intended to provide a safe environment to perform system maintenance. Originally this runlevel provided a single terminal (console) interface running a root login shell. The increasing trend towards physical access to the boot process has led to changes in this area.

The GNU/Linux operating system can make use of runlevels through the programs of the sysvinit project. After the Linux kernel has booted, the init program reads the /etc/inittab file to determine the behavior for each runlevel. Unless the user specifies another value as a kernel boot parameter, the system will attempt to enter (start) the default runlevel.

On most systems users can check the current runlevel with either of the following commands:

$ runlevel         # as root
$ who -r           # as any user

Most Linux distributions, in addition to the standard runlevels, define the following additional runlevels:

Typical Linux runlevels
ID Name Description
1 Single-User Mode Does not configure network interfaces, start daemons, or allow non-root logins.[1]
2 Multi-User Mode Does not configure network interfaces or start daemons.[2]
3 Multi-User Mode with Networking Starts the system normally.[2]
4 Unused
5 X11 Runlevel 3 + X Window System.

[1] = The additional behavior of this runlevel varies greatly. All distributions provide at least one virtual terminal. Some distributions start a login shell as the superuser; some require correctly entering the superuser's password first; others provide a login prompt, allowing any user access.

[2] = In some cases, runlevels 2 and 3 function identically; offering a Multi-User Mode with Networking.

Which services are started in which runlevels can be managed with the chkconfig tool, which keeps its configuration settings in a mildly elaborate arrangement under /etc/rc.d/. /sbin/chkconfig --list lists all the services controlled by chkconfig and whether they are on/off for each runlevel. Setting a service A controlled by chkconfig, for levels X, Y and Z is as simple as /etc/chkconfig --level XYZ A

Debian, as well as most of the distributions based on it, like Ubuntu, does not make any distinction between runlevels 2 to 5. See also the Debian FAQ on booting.

  • 0 - Halt
  • 1 - Single
  • 2 - Full multi-user with display manager (GUI)
  • 3 - Full multi-user with display manager (GUI)
  • 4 - Full multi-user with display manager (GUI)
  • 5 - Full multi-user with display manager (GUI)
  • 6 - Reboot

Red Hat as well as most of its derivatives uses runlevels like this

  • 0 - Halt
  • 1 - Single
  • 2 - Not used/User definable
  • 3 - Full multi-user NO display manager
  • 4 - Not used/User definable
  • 5 - Full multi-user with display manager (GUI)
  • 6 - Reboot

SUSE uses a similar setup as Red Hat:

  • 0 - Halt
  • 1 - Single
  • 2 - Full multi-user with no networking
  • 3 - Full multi-user NO display manager
  • 4 - Not used/User definable
  • 5 - Full multi-user with display manager (GUI)
  • 6 - Reboot

Slackware Linux uses runlevel 1 for maintenance, as on other Linux distributions; runlevels 2, 3 and 5 identically configured for a console (with all services active); and runlevel 4 adds the X Window System.

  • 0 - Halt
  • 1 - Single
  • 2 - Full multi-user NO display manager
  • 3 - Full multi-user NO display manager
  • 4 - Full multi-user with display manager (GUI)
  • 5 - Not used/User definable
  • 6 - Reboot

  • 0 - Halt
  • 1 - Single
  • 2 - No network
  • 3 - Full multi-user with display manager
  • 4 - Full multi-user with display manager (Alias for runlevel 3)
  • 5 - Full multi-user with display manager (Alias for runlevel 3)
  • 6 - Reboot

  • 0 - shut down system, power-off if hardware supports it (only available from the console)
  • 1 - single-user mode, all filesystems unmounted but root, all processes except console processes killed
  • 2 - multi-user mode
  • 3 - multi-user mode with RFS (and NFS in release 4) filesystems exported
  • 4 - multi-user, user-defined
  • 5 - halt the operating system, go to firmware
  • 6 - halt the system, reboot to default runlevel
  • s, S - identical to 1 except current terminal acts as the system console

  • 0 - operating system halted; (SPARC only) drop to OpenBoot prompt
  • S - single-user with only root filesystem mounted (as read-only)
  • 1 - single-user mode with all local filesystems mounted (read-write)
  • 2 - multi-user with most daemons started.
  • 3 - multi-user, identical to 2 (runlevel 3 runs both /sbin/rc2 and /sbin/rc3), with filesystems exported, plus some other network services started.
  • 4 - alternative multi-user, user defined
  • 5 - shut down, power-off if hardware supports it
  • 6 - reboot

  • 0 - system halted
  • S - single-user, booted to system console only, with only root filesystem mounted (as read-only)
  • s - single user, identical to S except the current terminal acts as the system console
  • 1 - single-user with local filesystems mounted (read-write)
  • 2 - multi-user with most daemons started and Common Desktop Environment launched
  • 3 - multi-user, nearly identical to runlevel 2 with NFS exported
  • 4 - multi-user with VUE started instead of CDE
  • 5 - user-defined
  • 6 - user-defined

AIX does not follow the System V R4 (SVR4) run level specification. It defines run levels from 0 to 9, 0 and 1 are reserved, 2 is the default normal multiuser mode and run levels from 3 to 9 are defined by administrator.

AIX runlevels
ID Name Description
0 reserved
1 reserved
2 Normal multiuser mode default mode

On AIX you can check the current runlevel with the following command:

$ who -r

Init

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.