Init![]() ![]() In Unix-based computer operating systems, init (short for initialization) is the first 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; 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 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,[1][failed verification] most Linux distributions 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-styleResearch Unix init runs the initialization shell script located at BSD init was, prior to 4.3BSD, the same as Research UNIX's init;[4][5] in 4.3BSD, it added support for running a windowing system such as X on graphical terminals under the control of A fully modular system was introduced with NetBSD 1.5 and ported to FreeBSD 5.0 and successors. This system executes scripts in the SysV-style![]() When compared to its predecessors, AT&T's UNIX System III introduced a new style of system startup configuration,[9] 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. RunlevelsThe 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 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, usually with a display manager like GDM or KDM. However, the Solaris and illumos 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 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 implementationsTraditionally, 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:
As of February 2019[update], systemd has been adopted by most major Linux distributions.[24] See also
References
External links
|
Portal di Ensiklopedia Dunia