View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Init

From LQWiki

Jump to: navigation, search

init is the mother of all processes. It is started by the kernel when the system is first booted. Init reads the file /etc/inittab and uses the information in it to start processes, daemons, and login prompts based on the current runlevel. If for some reason a daemon is killed, it will be respawned.

init is also the command to switch between run levels

SysV

These days, with the SysV-style init that most Linux distributions use, /etc/inittab tells init to run startup scripts contained in /etc/rc.d and /etc/init.d. The scripts in /etc/init.d are written to start or stop daemons. The files in /etc/rc.d/rc*.d are symbolic links to those scripts, named in a way that tells /etc/rc.d/rc whether to start or stop the process.

BSD

In Slackware, with its BSD-style init scripts, init reads the /etc/rc.d/rc.S script and takes further actions based on runlevels defined by other scripts in /etc/rc.d/.

rc.K is run in single-user mode, rc.M in multi-user mode, rc.6 reboots, and rc.0 is the only symlink in the process, being a different invocation of rc.6 that halts the system. If the non-default graphical boot of runlevel 4 is chosen, rc.4 will be read. These scripts check for the executable existence of a few other rc.foo files and lastly hand it off to /etc/rc.d/rc.local, where local setup commands are placed. Enabling or disabling services is handled via commenting, uncommenting, or otherwise editing the relevant commands in the script or chmod's of the scripts.

As there is no keeping up with dozens or hundreds of numbered and sequenced repetitive symlinks in several subdirectories, many users find it simpler and more efficient but the majority of distros use the SysV style and many of their users find it superior.


Personal tools