Linux Boot Process – Init

Home / Linux Boot Process – Init

Linux Boot Process – Init

December 9, 2015 | Article | No Comments

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.

SysV-style

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.

Runlevels

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-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.

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.

systemd

System management daemon designed exclusively for the Linux kernel. Like init, systemd is a daemon that manages other daemons.

Upstart

Event-based replacement for traditional init daemon.

Other

These are alternatives used to replace Sys-V and BSD-style init:

  1. BootScripts
  2. busybox-init
  3. DEMONS
  4. eINIT
  5. Initng
  6. launchd
  7. Mudur
  8. runit
  9. s6
  10. Service Management Facility
  11. SystemStarter

About Author

about author

xathrya

A man who is obsessed to low level technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial