Translation(s): English - Français - Italiano - Русский
BootProcess > init
Init is the first program to run after your system is booted, and continues to run as process number 1 until your system halts. Init's job is to start other programs that are essential to the operation of your system. All other processes are descended from init.
Overview
The system initialization process is handled by the init daemon. In squeeze and earlier releases, that daemon is provided by the sysvinit package, and no alternatives are supported. In wheezy, the default init daemon is still sysvinit, but a "technology preview" of systemd is available. In jessie and stretch, the default init system is systemd, but switching to sysvinit is supported.
Since jessie, only systemd is fully supported; sysvinit is mostly supported, but Debian packages are not required to provide sysvinit start scripts. Support for init systems other than systemd is significantly improved in Bullseye. runit is also packaged, but has not received the same level of testing and support as the others, and is not currently supported as PID 1. As of Bullseye, a collection of sysvinit start scripts that have been removed from their original packages is provided in the orphan-sysvinit-scripts package.
Determining the init system
In general, you can determine which init system is installed by checking whether the /sbin/init file is a symlink. If it's not a symlink, then sysvinit is probably in use. If it's a symlink pointing to /lib/systemd/systemd then systemd is in use. If it's a symlink pointing to /lib/sysvinit/init then sysvinit is in use.
If you suspect that the init system may have been changed without a reboot, you may also cat /proc/1/comm to see which command name was used for the init daemon during the most recent boot.
Changing the init system
In stretch, you may change from systemd to sysvinit by performing these steps:
apt-get install sysvinit-core
- reboot
During most of stretch's time as testing, you could change from systemd to runit by performing these steps:
apt-get install runit-systemd
- reboot
apt-get install runit-init
- reboot again
However, the runit-init package was removed from Debian shortly before stretch's release. Currently, runit is not supported as an init system in Debian, although that may change in the future, and might work in testing or unstable, any attempt to do this is done at your own risk. (See 861536 for discussion of the removal.)
Sysvinit configuration
The inittab configuration tells init what to do. Especially it contains the lines:
id:2:initdefault: si::sysinit:/etc/init.d/rcS l2:2:wait:/etc/init.d/rc 2
Which causes the files /etc/init.d/rcS to run initialization scripts (in /etc/rcS.d/*), then scripts for requested runlevel (in /etc/rcS.[0-9]/*).
See also
Init(1) man page (from systemd-sysv).
Init(8) man page (from sysvinit-core).
http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html
- update-rc.d, the equivalent to chkconfig