Version 7 Unix: /etc listing, showing init and rc
Version 7 Unix: contents of an /etc/rc Bourne shell script

In Unix-like computer operating systems, init (short for initialization) is the first user-space process started during booting of the operating system. Init is a daemon process that continues running until the system is shut down. It is the direct or indirect ancestor of all other processes and automatically adopts all orphaned processes. Init is started by the kernel during the booting process; in most Unix-like systems, a kernel panic will occur if the kernel is unable to start it or if it dies for any reason. Init is typically assigned process identifier 1.

In Unix systems such as System III and System V, the design of init diverged from the functionality provided by the init in Research Unix and its BSD derivatives. Up until the early 2010s,[failed verification] most Linux distributions employed a traditional init that was somewhat compatible with SystemV, while some distributions such as Slackware use BSD-style startup scripts, and other distributions such as Gentoo have their own customized versions.

Since then, most Linux distributions have employed a more modern init system, with most employing the init provided by the systemd project. Some distributions have elected to create their own System V-init compatible system, such as Gentoo Linux's OpenRC and Void Linux's runit. These projects typically include features originally not in System V's init, such as multi-threading or interactive init. Most modern init systems are also able to dynamically start, stop and enable services after boot with prompting by the user.

Research Unix-style/BSD-style

Research Unix init runs the initialization shell script located at /etc/rc, then launches getty on terminals under the control of /etc/ttys. There are no runlevels; the /etc/rc file determines what programs are run by init. The advantage of this system is that it is simple and easy to edit manually. However, new software added to the system may require changes to existing files that risk producing an unbootable system.

BSD init was, prior to 4.3BSD, the same as Research UNIX's init; in 4.3BSD, it added support for running a windowing system such as X on graphical terminals under the control of /etc/ttys. To remove the requirement to edit /etc/rc, BSD variants have long supported a site-specific /etc/rc.local file that is run in a sub-shell near the end of the boot sequence.

A fully modular system was introduced with NetBSD 1.5 and ported to FreeBSD 5.0, OpenBSD 4.9 and successors. This system executes scripts in the /etc/rc.d directory. Unlike System V's script ordering, which is derived from the filename of each script, this system uses explicit dependency tags placed within each script. The order in which scripts are executed is determined by the rcorder utility based on the requirements stated in these tags.

SysV-style

sysv-rc-conf, a TUI utility that selects which SysV-style init scripts will be run in each runlevel

When compared to its predecessors, AT&T's UNIX System III introduced a new style of system startup configuration, which survived (with modifications) into UNIX System V and is therefore called the "SysV-style init".

At any moment, a running System V is in one of the predetermined number of states, called runlevels. At least one runlevel is the normal operating state of the system; typically, other runlevels represent single-user mode (used for repairing a faulty system), system shutdown, and various other states. Switching from one runlevel to another causes a per-runlevel set of scripts to be run, which typically mount filesystems, start or stop daemons, start or stop the X Window System, shutdown the machine, etc.

Runlevels

The runlevels in SystemV describe certain states of a machine, characterized by the processes and daemons running in each of them. In general, there are seven runlevels, out of which three runlevels are considered "standard", as they are essential to the operation of a system:

  1. Turn off
  2. Single-user mode (also known as S or s)
  3. Reboot

Aside from these standard ones, Unix and Unix-like systems treat runlevels somewhat differently. The common denominator, the /etc/inittab file, defines what each configured runlevel does in a given system.

Default runlevels

Operating systemDefault runlevel
AIX2
antiX5
Gentoo Linux3
HP-UX3 (console/server/multiuser) or 4 (graphical)
Slackware Linux3
Solaris / illumos3
UNIX System V Releases 3.x, 4.x2
UnixWare 7.x3

On Linux distributions defaulting to runlevel 5 in the table on the right, runlevel 5 invokes a multiuser graphical environment running the X Window System, usually with a display manager like GDM or KDM. However, the Solaris and illumos operating systems typically reserve runlevel 5 to shut down and automatically power off the machine.

On most systems, all users can check the current runlevel with either the runlevel or who -r command. The root user typically changes the current runlevel by running the telinit or init commands. The /etc/inittab file sets the default runlevel with the :initdefault: entry.

On Unix systems, changing the runlevel is achieved by starting only the missing services (as each level defines only those that are started / stopped).[citation needed] For example, changing a system from runlevel 3 to 4 might only start the local X server. Going back to runlevel 3, it would be stopped again.

Other implementations

Traditionally, one of the major drawbacks of init is that it starts tasks serially, waiting for each to finish loading before moving on to the next. When startup processes end up Input/output (I/O) blocked, this can result in long delays during boot. Speeding up I/O, e.g. by using SSDs, may shorten the delays but it does not address the root cause.

Various efforts have been made to replace the traditional init daemons to address this and other design problems, including:

General

NameDeveloperLatest releaseLicenseNotes
VersionDate
BootScriptsGoboLinux Scripts Contributors016.02August 16, 2017; 9 years agoGPL
busybox-initBruce Perens etc.1.36.119 May 2023; 3 years agoGPL-2.0-only Since 1.3.0 GPL-2.0-or-later Until 1.2.2.1
dinitDavin McCall0.22.14 July 2026; 59 days agoAL2
EpochEpoch Contributors1.3.0June 24, 2015; 11 years agoUnlicense
finitJoachim Wiberg, etc.4.17April 28, 2026; 4 months agoMIT
ginitdS. M. Wood-Mattheusson
InitngInitng Contributors0.6.10.2March 25, 2007; 19 years agoGPL-3.0
launchdApple Inc.10.4April 29, 2005; 21 years agoProprietary (was APSL then AL2)
OpenRCRoy Marples etc.0.63.32 July 2026; 1 month agoBSD-2-Clause
procdDaniel Golle, etc.June 17, 2026; 2 months agoGPL-2.0-only
runitGerrit Pape etc.2.3.17 February 2026; 6 months agoBSD-3-Clause
s6Laurent Bercot2.15.1.014 July 2026; 49 days agoISC
Service Management Facility (SMF)Sun Microsystems5.10January 31, 2005; 21 years agoCDDL
ShepherdLudovic Courtèsetc.1.0.93 December 2025; 8 months agoGPL-3.0-or-later
systemdRed Hat345 in 20182,032 total261.223 July 2026; 40 days agoLGPL-2.1-or-later
SystemStarterWilfredo Sanchez10.4April 29, 2005; 21 years agoBSD
UpstartCanonical Ltd.1.13.2September 4, 2014; 11 years agoGPL-2.0-only
NameDeveloperLatest releaseLicenseNotes
VersionDate

Operating system support

NameLinuxBSDDarwinHurdSolarisOther
BootScriptsYesNoNoNoNoNo
busybox-initYesYesYesYesYesPOSIX
dinitYesYesYesYesYesPOSIX
EpochYesNoNoNoNoNo
finitYesNoNoNoNoNo
InitngYesYesNoNoNoHaiku
launchdNoNoYesNoNoNo
OpenRCYesYesNoNoNoNo
procdYesNoNoNoNoNo
runitYesYesYesYesYesPOSIX
s6YesYesYesYesYesPOSIX
Service Management Facility (SMF)NoNoNoNoYesNo
ShepherdYesNoNoYesNoNo
systemdYesNoNoNoNoNo
SystemStarterNoNoYesNoNoNo
UpstartYesNoNoNoNoNo
NameLinuxBSDDarwinHurdSolarisOther

Compatibility, interface and programming

Comparison of init systems
Namemusl libc compatibledependency freescript/ service formatPlain log formatPer- service configCross- service eventsParallel service startupProcess supervisionProgramming languageCodebase size (lines)
BootScripts??Shell scripts?????Shell66.6%; C19.0%; Python12.7%; Other1.7%?
busybox-init????????C90.4%; shellscript4.6%; C++1.7%; HTML1.4%; Assembly0.8%; Make0.5%; XML0.2%; Perl0.3%; Python0.1%320,773
dinitYesYesText configYesYesYesYesNativeC++96.1%; Starlark1.0%; C1.0%; Shell0.9%; Makefile0.7%; Zig0.2%; Go0.1%~25,000
EpochYeslibc, /bin/shmultiple or single .confYesYes (v1.1+)(basic support, v1.3+)NoYesC98.2%; shellscript1.8%; Make0.1%10,546
finit??multiple or single .confYes??YesYesC86.7%; shellscript9.7%; Automake1.8%; Autoconf1.5%; Make0.3%33,146
Initng????????C67.5%; Assembly12.8%; shellscript13.2%; Python2.7%; CMake1.5%; Jam1.1%; HTML0.6%; Make0.5%; VimScript0.1%59,471
launchd?Yesplist?YesNoYesYesC96.1%; shellscript2.2%; C++1.3%; Make0.4%; XML0.1%28,128
OpenRCYesinit (sysv or BSD)Shell scriptsYesYes (conf.d)YesDisabled by defaultVia external toolC87.6%; shellscript12.2%; Perl0.2%23,818
procd??Shell scripts?Yes??YesC98.8%; CMake0.8%; shellscript0.4%18,872
runitYesYesShell scriptsYesNoYesVia supervision treesNativeC57.4%; HTML32.1%; shellscript6.3%; Make4.0%; XML0.2%11,616
s6Yesexeclineexecline/ shellYesNoYesYesNativeC48.3%; HTML46.1%; shellscript2.8%; Autoconf2.0%; Make0.7%; EmacsLisp0.1%31,553
Service Management Facility (SMF)?init (sysv?)XML (+ shell scripts)YesYes (service instances)YesYesYesC?
Shepherd????????Scheme70.5%; shellscript28.3%; Automake0.7%; Autoconf0.4%6,606
systemdLimiteddbus udev dns ntp GNOME NetworkManager PipeWire ...Unit filesNo (journald)YesYesYesBuilt-in but opaqueC77.9%; XML12.5%; shellscript3.9%; Python3.2%; C++2.4%; CSS0.1%1,390,713
Upstart????????C93.1%; Python2.5%; Automake1.1%; C++2.4%; shellscript0.3%; XML0.3%; Autoconf0.1%; VimScript0.1%126,865
Namemusl libc compatibledependency freescript/ service formatPlain log formatPer- service configCross- service eventsParallel service startupProcess supervisionProgramming languageCodebase size (lines)

See also

External links