NAME
init — system initializationSYNOPSIS
init | [--target=init-target] |
DESCRIPTION
init is the first program run after system startup and is responsible for initializing the operating system and starting the specified init-target. This is normally a login screen, a root shell, or a dedicated special purpose program.Initialization Target
init first determines its target from the --target option if specified or /etc/init/target otherwise. Supported targets are:- chain
- mount real root filesystem and run its init
- chain-merge
- complete a sysmerge(8) upgrade during a chain boot
- multi-user
- boot to login(8)
- single-user
- boot to root shell without password (not secure)
- sysinstall
- boot to operating system installer (not secure)
- sysupgrade
- boot to operating system upgrader (not secure)
Partition Creation
init will scan every block device for valid partition tables and create the corresponding partition devices in /dev.Chain Initialization
The chain target mounts the root filesystem as in /etc/fstab (see fstab(5)) and runs the next init program. This is used by update-initrd(8) to make a bootstrap initrd(7).Configuration
Once the init of the real root filesystem runs, it will process basic configuration files and apply them:- /etc/hostname
- set hostname (see hostname(5))
- /etc/kblayout
- set keyboard layout (see kblayout(5))
- /etc/videomode
- set graphics resolution (see videomode(5))
Session
Finally init will start the target program according to its initialization target. This will be a login screen, a root shell, or something else. If the process exits abnormally init will automatically restart it. init will exit with the same exit status as the process if it exits normally. The kernel decides whether to power off, reboot or halt based on this exit status.ENVIRONMENT
init sets the following environment variables.- HOME
- root's home directory
- INIT_PID
- init's process id
- LOGNAME
- root
- PATH
- /bin:/sbin
- SHELL
- root's shell
- TERM
- sortix
- USER
- root
FILES
- /etc/init/target
- default initialization target
- /etc/fstab
- filesystem table (see fstab(5))
- /etc/hostname
- hostname (see hostname(5))
- /etc/kblayout
- keyboard layout (see kblayout(5))
- /etc/videomode
- graphics resolution (see videomode(5))