Search notes:

System V

init is called by the kernel when it has finished its booting sequence (See init/main.c)
init is the parent of all processes.

Init process

Init takes a parameter: the runlevel (1-6).
The «root» of all processes. Almost all daemons are spawned by init.
After setting everthing up, init goes to sleep and is only woken up
The init process runs in user space.

Run levels

The runlevels are controlled via the /etc/inittab file.
They determine which sub systems to run.
The runlevel is changed with /sbin/telnit.
Some systems also have runlevels 7-9.
Apparently runlevels S and s are synonyms.
The source code of init also talks about the fake run levels # for SYSINIT and * for BOOT and BOOTWAIT.

Configuration

The top level configuration file is /etc/inittab.

Init scripts

An init script requires an action (which is passed as a string to the script) which is one of start, stop, restart, try-restart, reload, force-reload or status.
Apparently, an init script is supposed to source /lib/lsb/init-functions.
Init scripts are located in /etc/rc*.
When init starts a new process, it first checks whether the script /etc/initscript is available. If so, this script is used to start the process.

Boot process

The first script that is called in the boot process is /etc/rc.d/init.d/rc.
The boot process can be somewhat configured in /etc/sysconfig/rc.site

See also

systemd
/dev/initctl
/etc/sysconfig/rc.site
/var/run/utmp

Index