Init
Encyclopedia : I : IN : INI : Init
- The correct title of this } is }}}. The initial letter is capitalized due to [Naming conventions #Lower case first lettertechnical restrictions].
The functionality diverged considerably between BSD and System V. The usage on most Linux distributions is compatible with System V, but some distributions, such as Slackware, use a BSD-style and others, such as Gentoo Linux, have their own customized version.
Opinions on the relative merits of different schemes can be strongly held, leading both to occasional "flame wars", and also to the development of several alternatives.
BSD-style
BSD init runs the initialization shell script located inAdvantages: 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.
SysV-style
System V init examines theAdvantages: Flexiblity and scalability.
Problems: Complexity.
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
Default runlevels
| OS or Distribution | Default runlevel |
|---|---|
| SUSE | 5 |
| Mandriva | 5 |
| Solaris | 3 |
| AIX | 2 |
On the two Linux distributions in the table above, runlevel 5 is a multiuser graphical environment running X, usually with a display manager such as xdm, kdm or gdm running. However, in the Solaris operating system, runlevel 5 is typically reserved to shutdown and automatically poweroff the machine.
On most systems users can check the current runlevel with either of the following commands:
$ runlevel
$ who -rThe 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 init
On 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/sbin/init). This is generally done by typing init=/foo/bar at the bootloader's prompt. Appending init=/bin/bash, for example, will bring up a single root shell, without a password. If the system administrator feels that this is insecure, they may setup a BIOS password.See also
- Unix System V
- Linux
- SystemStarter and launchd — Apple Mac OS X's process spawner
- Initng, a full replacement of init designed to start processes asynchronously
External links
- [man pages for init]
- Alternative init schemes:
- *[boot-scripts]
- *[runit]
- *[svscan from daemontools used as process 1]
- *[minit]
- *[rc.d]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
