Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Runlevel
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Mode of operation in computer operating systems}} {{Refimprove|date=August 2010}} A '''runlevel''' is a mode of operation in the computer [[operating system]]s that implements Unix [[System V]]-style [[init]]ialization. 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 (computing)|reboot]] system states. The exact setup of these configurations varies between operating systems and [[Linux distribution]]s. 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 {{Mono|[[/etc/rc]]}} script used in the [[Version 7 Unix]] was first replaced by runlevels and then by [[systemd]] states on most major distributions. == Standard runlevels == {| class="wikitable" |+Standard runlevels |- !ID !Name !Description |- |'''0''' |Off |Turns off the device. |- |'''1''' |[[Single user mode]] |Does not configure [[Virtual network interface|network interface]]s or start [[daemon (computer software)|daemons]].{{Efn|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 [[superuser|root]] login [[operating system shell|shell]]. The increasing trend towards physical access to the computer during the [[booting|boot]] process has led to changes in this area.}} |- |'''6''' |Reboot |Reboots the device. |} == Linux == Although systemd is, {{As of|2016|lc=yes}}, used by default in most major [[Linux]] distributions, runlevels can still be used through the means provided by the [[sysvinit]] project. After the [[Linux kernel]] has booted, the {{Mono|/sbin/init}} program reads the {{Mono|/etc/inittab}} file to determine the behavior for each runlevel. Unless the user specifies another value as a [[Linux kernel boot parameters|kernel boot parameter]], the system will attempt to enter (start) the default runlevel. === Linux Standard Base specification === Systems conforming to the [[Linux Standard Base]] (LSB) need not provide the exact run levels given here or give them the meanings described here, and may map any level described here to a different level which provides the equivalent functionality.<ref> {{cite web | url = http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/runlevels.html | title = Chapter 20. System Initialization 20.5. Run Levels | work = [[Linux Standard Base]] Core Specification 4.1 | year = 2011 | access-date = 2011-04-21}} </ref> {| class="wikitable" |+LSB 4.1.0 |- !ID !Name !Description |- |'''0''' |Off |Turns off the device. |- |'''1''' |Single-user mode |Mode for administrative tasks.<ref>{{cite web | url = http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/shutdown.html | title = Chapter 15. Commands and Utilities 15.2. Command Behavior | work = Linux Standard Base Core Specification 4.1 | year = 2011 | access-date = 2011-04-21}}</ref>{{Efn|The additional behavior of runlevel 1 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; others provide a login prompt, allowing access to any registered user.}} |- |'''2''' |Multi-user mode |Does not configure network interfaces and does not export networks services.{{Efn|In some cases, runlevels 2 and 3 function identically, offering a multi-user mode with networking.}} |- |'''3''' |Multi-user mode with networking |Starts the system normally.{{ref|behavior_of_runlevel_23}} |- |'''4''' |Not used/user-definable |For special purposes. |- |'''5''' |Full mode |Same as runlevel 3 + [[X display manager (program type)|display manager]]. |- |'''6''' |Reboot |Reboots the device. |} === Slackware Linux === [[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. {| class="wikitable" |+Slackware Linux runlevels<ref name="slackware_boot">{{cite web | title = Slackware Linux Runlevels | url = http://slackware.com/config/init.php | access-date = 2013-06-11}}</ref> |- !ID !Description |- |'''0''' |Off |- |'''1''' |Single-user mode |- |'''2''' |Unused but configured the same as runlevel 3 |- |'''3''' |Multi-user mode without display manager |- |'''4''' |Multi-user mode with display manager (X11 or a session manager) |- |'''5''' |Full mode |- |'''6''' |Reboot |} === Gentoo Linux === {| class="wikitable" |+[[Gentoo Linux]] runlevels<ref name="gentoo_boot">{{cite web | title = Gentoo Linux Runlevels | url = http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4 | access-date = 2013-06-11}}</ref> |- !ID !Description |- |'''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 === {| class="wikitable" style="width:20em" |+[[Debian GNU/Linux]] runlevels<ref>{{cite web | title = Debian runlevel manpage | url = https://manpages.debian.org/man/8/runlevel | access-date = 2021-10-31}}</ref> |- !ID !Description |- |'''0''' |Off |- |'''1''' |Recovery mode |- |'''2,3,4''' |Partial mode |- |'''5''' |Full mode |- |'''6''' |Reboot |} == Unix == === System V Releases 3 and 4 === {| class="wikitable" |+[[System V]] runlevels |- !ID !Description |- |'''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 [[Remote File System|RFS]] (and [[Network File System (protocol)|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 === Starting from Solaris 10, SMF ([[Service Management Facility]]) is used instead of SVR4 run levels. The latter are emulated to preserve compatibility with legacy startup scripts.<ref name="solaris_boot">{{cite web | title = Solaris Boot Process | url = https://blogs.oracle.com/boot/entry/amrita_sadhukhan | author = Amrita Sadhukhan | publisher = [[Sun Microsystems|Sun]] | access-date = 2009-08-19 | archive-date = 2013-07-09 | archive-url = https://web.archive.org/web/20130709063354/https://blogs.oracle.com/boot/entry/amrita_sadhukhan | url-status = dead }}</ref> {| class="wikitable" |+[[Solaris (operating system)|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 {{mono|/sbin/rc2}} and {{mono|/sbin/rc3}}), 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 === {| class="wikitable" |+[[HP-UX]] runlevels |- !ID !Description |- |'''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 [[Daemon (computer software)|daemons]] started and [[Common Desktop Environment]] launched |- |'''3''' |Identical to runlevel '''2''' with NFS exported |- |'''4''' |Multi-user mode with [[Visual User Environment|VUE]] started instead of CDE |- |'''5''', '''6''' |Not used/User-definable |} === AIX === [[AIX (operating system)|AIX]] does not follow the [[System V]] R4 (SVR4) runlevel specification, with runlevels from 0 to 9 available, as well as from a to c (or h). 0 and 1 are reserved, 2 is the default normal multi-user mode and runlevels from 3 to 9 are free to be defined by the administrator. Runlevels from a to c (or h) allow the execution of processes in that runlevel without killing processes started in another. {| class="wikitable" |+AIX runlevels |- !ID !Name !Description |- |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. == See also == * [[Init]] * [[Operating system service management]] * [[systemd]] * [[Upstart (software)|Upstart]] == Notes == {{Notelist|40em}} == References == {{Reflist|40em}} == External links == * [http://www.linfo.org/runlevel_def.html Runlevel Definition] - by The Linux Information Project (LINFO) * [http://wiki.linuxquestions.org/wiki/Run_Levels What are run levels?] - LinuxQuestions.org * [https://www.freebsd.org/doc/en/articles/linux-users/startup.html FreeBSD system startup] * [https://web.archive.org/web/20150816014626/http://linuxcommand.org/man_pages/chkconfig8.html chkconfig], a utility for querying and updating runlevel-controlled services [[Category:Unix]] [[Category:Unix process- and task-management-related software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:As of
(
edit
)
Template:Cite web
(
edit
)
Template:Efn
(
edit
)
Template:Mono
(
edit
)
Template:Notelist
(
edit
)
Template:Ref
(
edit
)
Template:Refimprove
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)