A runlevel is a mode of operation in the computer that implements Unix System V-style . Conventionally, seven runlevels exist, numbered from zero to six. S is sometimes used as a synonym for one of the levels. Only one runlevel is executed on startup; run levels are not executed one after another (i.e. only runlevel 2, 3, or 4 is executed, not more of them sequentially or in any other order).
A runlevel defines the state of the machine after boot. Different runlevels are typically assigned (not necessarily in any particular order) to the single-user mode, multi-user mode without network services started, multi-user mode with network services started, system shutdown, and system reboot system states. The exact setup of these configurations varies between operating systems and Linux distributions. For example, runlevel 4 might be a multi-user GUI no-server configuration on one distribution, and nothing on another. Runlevels commonly follow the general patterns described in this article; however, some distributions employ certain specific configurations.
In standard practice, when a computer enters runlevel zero, it shuts off, 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. Default runlevels are typically 3, 4, or 5. Lower runlevels are useful for maintenance or emergency repairs, since they usually offer no network services at all. The particular details of runlevel configuration differ widely among operating systems, and also among system administrators.
In various Linux distributions, the traditional script used in the Version 7 Unix was first replaced by runlevels and then by systemd states on most major distributions.
| +Standard runlevels | ||
| 0 | Off | Turns off the device. |
| 1 | Single user mode | Does not configure network interfaces or start daemons. |
| 6 | Reboot | Reboots the device. |
| +Gentoo Linux runlevels | |
| 0 | Off |
| 1 or S | Single-user mode |
| 2 | Multi-user mode without networking. |
| 3 | Multi-user mode |
| 4 | Aliased for runlevel 3 |
| 5 | Full mode |
| 6 | Reboot |
| +Debian GNU/Linux runlevels | |
| 0 | Off |
| 1 | Recovery mode |
| 2,3,4 | Partial mode |
| 5 | Full mode |
| 6 | Reboot |
| +System V runlevels | |
| 0 | Off |
| 1 | Single-user mode, all filesystems unmounted but not 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-definable |
| 5 | Go to firmware |
| 6 | Reboot |
| s, S | Identical to 1, except current terminal acts as the system console |
| +Solaris runlevels !ID !Description | |
| 0 | On SPARC systems, it returns to firmware, while on x86 systems, it shuts off the machine. If the user presses Enter, the system reboots. |
| S | Single-user mode with only root filesystem mounted (as read-only) -- Solaris 10+: svc:/milestone/single-user |
| 1 | Single-user mode with all local filesystems mounted (read-write) |
| 2 | Multi-user mode with most daemons started – Solaris 10+: svc:/milestone/multi-user |
| 3 | Multi-user mode; identical to 2 (runlevel 3 runs both and ), with filesystems exported, plus some other network services started. -- Solaris 10+: svc:/milestone/multi-user-server |
| 4 | Alternative Multi-user mode, User-definable |
| 5 | Off |
| 6 | Reboot |
| +HP-UX runlevels | |
| 0 | Off |
| S | Single-user mode, booted to system console only, with only root filesystem mounted (as read-only) |
| s | Single-user mode, identical to S except the current terminal acts as the system console |
| 1 | Single-user mode with local filesystems mounted (read-write) |
| 2 | Multi-user mode with most daemons started and Common Desktop Environment launched |
| 3 | Identical to runlevel 2 with NFS exported |
| 4 | Multi-user mode with VUE started instead of CDE |
| 5, 6 | Not used/User-definable |
| +AIX runlevels | ||
| 0 | reserved | |
| 1 | reserved | |
| 2 | Normal Multi-user mode | default mode |
The S, s, M and m runlevels are not true runlevels, but are used to tell the init command to enter maintenance mode. When the system enters maintenance mode from another runlevel, only the system console is used as the terminal.
|
|