Ph: 461286122

init

From Wikipedia, the free encyclopedia
Jump to: navigation, search

init (short for initialization) is a program for Unix-based computer operating systems that spawns all other processes. It runs as a daemon and typically has PID 1. The boot loader starts the kernel and the kernel starts init. If one were to delete init without a replacement, the system would encounter a kernel panic on the next reboot.

The functionality diverged, in Unix systems such as System III and System V, from the functionality provided by the init in Research Unix and its BSD derivatives. The usage on most Linux distributions is compatible with System V, but some distributions, such as Arch, use a BSD-style and others, such as Gentoo, have their own customized version.

Several replacements for init have been written which attempt to address design limitations such as systemd or Upstart, used by Ubuntu[1][2] and some other Linux distributions.[3][4]

[edit] SysV-style

System V init examines the /etc/inittab file for an :initdefault: entry, which tells init whether there is a default runlevel. If there is no default runlevel, then the user is dumped to a system console, where a runlevel must be entered manually.

[edit] Runlevels

The runlevels in System V describe certain states of a machine, characterized by the processes run. There are generally 8 runlevels. These are the runlevels 0 to 6 and S or s, which are aliased to the same runlevel. Of these eight, 3 are so-called "reserved" runlevels:

0. Halt
1. Single user mode
6. Reboot

Aside from runlevels 0, 1, and 6, every Unix and Unix-like system treats runlevels a little differently. The common denominator is the /etc/inittab file, which defines what each runlevel does (if they do anything at all).

[edit] Default runlevels

On the Linux distributions defaulting to runlevel 5 in the table above, runlevel 5 is a multiuser graphical environment running the X Window System, usually with a display manager. However, in the Solaris operating system, runlevel 5 is typically reserved to shut down and automatically power off the machine.

On most systems users can check the current runlevel with either of the following commands:

$ runlevel
$ who -r

The current runlevel is typically changed by root running the telinit or init commands. The default runlevel is set in the /etc/inittab file with the :initdefault: entry.

[edit] BSD-style

BSD init runs the initialization shell script located in /etc/rc, then launches getty on text-based terminals or a windowing system such as X on graphical 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. To mitigate against this, 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 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.[9] The order in which scripts are executed is determined by the rcorder script based on the requirements stated in these tags.

[edit] Replacements for init

Various efforts have been made to replace the traditional init daemons with something better, including:

BootScripts in GoboLinux DEMONS, a modification of the init start process by KahelOS, where daemons are started only when the DE (desktop environment) started. eINIT, a full replacement of init designed to start processes asynchronously, but with the potential of doing it without shell-scripts Initng, a full replacement of init designed to start processes asynchronously launchd, a replacement for init introduced in Mac OS X v10.4 (it launches SystemStarter to run old-style 'rc.local' and SystemStarter processes) Mudur, an init replacement written in Python and designed to start process asynchronously in use by the Pardus Linux distribution.[10] OpenRC, the default init system for Gentoo Linux runit, a cross-platform full replacement for init with parallel starting of services Service Management Facility, a complete full replacement/redesign of init from the ground up in Solaris starting with Solaris 10 systemd, a full replacement for init with parallel starting of services, reduced shell overhead and other features, used by Fedora 15. 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

[edit] See also

[edit] References

[edit] External links

Personal tools
Namespaces
Variants
Actions


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser