|
init (short for "initialization") is the program on Unix and Unix-like systems that spawns all other processes. It runs as a daemon and typically has PID 1. The functionality diverged, in Unixes 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 Linux and Slackware, use a BSD-style and others, such as Gentoo Linux, have their own customized version.
BSD-styleBSD 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. There are no runlevels; the 'rc' file determines how init is to be run. Advantages: Simple and easy to edit manually. Problems: If a 3rd-party package needs to have an initialization script run during the boot procedure, it needs to edit one of the existing boot scripts, but a simple mistake in that process could lead to an unbootable system. Note that modern *BSD variants have long supported a site-specific 'rc.local' file that is run in a sub-shell near the end of the boot sequence to mitigate the risks of making the system unbootable, and later, a local 'rc.d' directory where packages could install their own independent start/stop scripts (usually provided by the ports collection/pkgsrc). FreeBSD and NetBSD now use by default (as of version 5.0 and 1.5, respectively) the rc.d framework where the whole userland boot sequence is fragmented into smaller scripts, similarly to SysV. rcorder is used to determine in which order scripts are run, based on dependency information contained in the rc.d scripts. SysV-styleSystem 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. Advantages: Flexibility and scalability. Problems: Complexity. RunlevelsThe 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:
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). Default runlevels
On the two 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. Skipping initIn Linux systems, with most modern bootloaders (such as LILO or GRUB), users can change which process the kernel spawns at the end of its initialization from the normal default of For BSD variants, on most platforms, the bootstrap program can be interrupted and given the Other stylesVarious efforts have been made to replace the traditional init daemons with something better. Below is a list of these alternatives in no particular order.
The following list are links to projects that are not (yet) in widespread use.
See also
External links |
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net