
In
Unix
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
-based computer
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, init (short for ''initialization'') is the first
process
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
* Business process, activities that produce a specific s ...
started during
booting
In computing, booting is the process of starting a computer as initiated via Computer hardware, hardware such as a physical button on the computer or by a software command. After it is switched on, a computer's central processing unit (CPU) h ...
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
An ancestor, also known as a forefather, fore-elder, or a forebear, is a parent or ( recursively) the parent of an antecedent (i.e., a grandparent, great-grandparent, great-great-grandparent and so forth). ''Ancestor'' is "any person from ...
of all other processes and automatically adopts all
orphaned processes. Init is started by the
kernel during the
booting
In computing, booting is the process of starting a computer as initiated via Computer hardware, hardware such as a physical button on the computer or by a software command. After it is switched on, a computer's central processing unit (CPU) h ...
process; a
kernel panic will occur if the kernel is unable to start it, or it should die for any reason. Init is typically assigned
process identifier
In computing, the process identifier (a.k.a. process ID or PID) is a number used by most operating system kernel (operating system), kernels—such as those of Unix, macOS and Windows—to uniquely identify an active Process (computing), process. ...
1.
In Unix systems such as
System III and
System V, the design of init has diverged from the functionality provided by the init in
Research Unix and its
BSD derivatives. Up until the early 2010s, most
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s employed a traditional init that was somewhat compatible with System V, while some distributions such as
Slackware use BSD-style startup scripts, and other distributions such as
Gentoo have their own customized versions.
Since then, several additional init implementations have been created, attempting to address design limitations in the traditional versions. These include
launchd, the
Service Management Facility,
systemd,
Runit and
OpenRC.
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
NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was fork (software development), forked. It continues to ...
1.5 and ported to
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
5.0 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

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
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
, shutdown the machine, etc.
Runlevels
The
runlevels in System V 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:
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
On Linux distributions defaulting to runlevel 10 in the table on the right, runlevel 10 invokes a multiuser graphical environment running the
X Window System
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
, usually with a
display manager like
GDM or
KDM. However, the
Solaris and
illumos
Illumos (stylized as "illumos") is a partly free and open-source Unix operating system. It has been developed since 2010 and is based on OpenSolaris, after the discontinuation of that product by Oracle. It comprises a kernel, device driver ...
operating systems typically reserve runlevel 10 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
In vascular plants, the roots are the plant organ, organs of a plant that are modified to provide anchorage for the plant and take in water and nutrients into the plant body, which allows plants to grow taller and faster. They are most often bel ...
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). 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
In computing, input/output (I/O, i/o, or informally io or IO) is the communication between an information processing system, such as a computer, and the outside world, such as another computer system, peripherals, or a human operator. Inputs a ...
(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:
*
BootScripts in
GoboLinux
*
busybox-init, suited to
embedded operating systems, used by
Alpine Linux (before being replaced with
OpenRC),
SliTaz 5 (Rolling),
Tiny Core Linux, and
VMware ESXi, and used by
OpenWrt
OpenWrt (from ''open wireless router'') is an open-source project for embedded operating systems based on Linux kernel, Linux, primarily used on Embedded system, embedded devices to Router (computing), route network traffic. The main components ...
before it was replaced with
procd
* Dinit, a service manager and init system.
*
Epoch
In chronology and periodization, an epoch or reference epoch is an instant in time chosen as the origin of a particular calendar era. The "epoch" serves as a reference point from which time is measured.
The moment of epoch is usually decided b ...
, a single-threaded Linux init system focused on simplicity and service management
*
ginitd, a software package that consists of an init system and a service management system
*
Initng, a full replacement of init designed to start processes asynchronously
*
launchd, a replacement for init in
Darwin/
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
/
iOS/
tvOS
tvOS (formerly Apple TV Software) is an operating system developed by Apple for the Apple TV, a digital media player. In the first-generation Apple TV, Apple TV Software was based on Mac OS X. The software for the second-generation and later ...
starting with
Mac OS X v10.4 (it launches SystemStarter to run old-style
'rc.local' and SystemStarter processes)
*
OpenRC, a process spawner that utilizes system-provided init, while providing process isolation, parallelized startup, and service dependency; used by
Alpine Linux,
Gentoo and its derivatives, and available as an option in
Devuan and
Artix Linux.
*
runit, a cross-platform full replacement for init with parallel starting of services, used by default in
Void Linux
* Sun
Service Management Facility (SMF), a complete replacement/redesign of init from the ground up in
illumos
Illumos (stylized as "illumos") is a partly free and open-source Unix operating system. It has been developed since 2010 and is based on OpenSolaris, after the discontinuation of that product by Oracle. It comprises a kernel, device driver ...
/
Solaris starting with Solaris 10, but launched as the only service by the original System V-style init
*
Shepherd
A shepherd is a person who tends, herds, feeds, or guards flocks of sheep. Shepherding is one of the world's oldest occupations; it exists in many parts of the globe, and it is an important part of Pastoralism, pastoralist animal husbandry. ...
, the
GNU service and daemon manager which provides asynchronous, dependency-based initialisation; written in
Guile Scheme and meant to be interactively hackable during normal system operation
*
s6, a software suite that includes an init system.
*
systemd, a software suite, full replacement for init in Linux that includes an init daemon, with concurrent starting of services, service manager, and other features. Used by
Debian
Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
(replaces SysV init) and
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
, among other popular Linux distributions.
*
SystemStarter, a process spawner started by the BSD-style init in
Mac OS X prior to Mac OS X v10.4
*
Upstart, a full replacement of init designed to start processes asynchronously. Initiated by
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
and used by them until 2014. It was also used in Fedora 9, Red Hat Enterprise Linux 6 and
Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
's
ChromeOS.
, systemd has been
adopted by most major Linux distributions.
[See Systemd#Adoption]
See also
*
Operating system service management
*
Session Manager Subsystem — an equivalent in Windows NT
References
External links
FreeBSD init man pageA paper summarizing Unix init schemes(2007)
*
A history of modern init systems (1992–2015)
{{Service management in Unix
Unix process- and task-management-related software