In Unix-based OS, init (short for initialization) is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shutdown. It performs many things and also served as the ‘mother’ of processes.
Once init starts, “swapper” part on kernel goes into the sleep state, into an idle loop and rest of the bootup process is taken up by init process. The old init systems such as SysV-style and BSD-style is based on a single process which load the application serially using script. A newer system such as system and upstart can init system in parallel to speed up the process.
System V init is one of init system used by major Linux distribution. SysV init examines the /etc/inittab file for an :initdefault: entry, which defines any default runlevel. If there is no default runlevel, then init dumps the user to a system console for manual entry of a runlevel.
States in which system is running at. It describe certain states of a machine, characterized by the processes run. There are generally eight runlevels, three of which are standard:
- Runlevel 0 : Halt
- Runlevel 1 : Single user mode (aka. S or s)
- Runlevel 6 : Reboot
Aside from these, every Unix and Unix-like system treats runlevels a little differently. The commond denominator, the /etc/inittab file, defines what each runlevel does in a given system. For example, there are runlevels such as:
- multiuser mode
- multiuser mode with networking support
- GUI mode
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.
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 script based on the requirements stated in these tags.
Slackware use this.
System management daemon designed exclusively for the Linux kernel. Like init, systemd is a daemon that manages other daemons.
Event-based replacement for traditional init daemon.
These are alternatives used to replace Sys-V and BSD-style init:
- Service Management Facility