Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
|INIT(8)||System Manager's Manual||INIT(8)|
initis the first program run after system startup and is responsible for initializing the operating system. Each daemon(7) is started in order as its dependencies become ready per its init(5) configuration. The default daemon is automatically started and its recursive dependencies constitute the operating system. The default daemon's single dependency is referred to as the target. The kernel(7) starts the system in a temporary environment with a root filesystem backed by system memory and extracts the initrd(7) into it. The kernel runs the /sbin/init program of the system memory root filesystem as the first process. If the system is on bootable cdrom, then the initrd will be a fully functional system and
initwill start a live environment or an operating system installer. If the system is installed on a harddisk, then the initrd is a minimal system made with update-initrd(8) that will search for the actual root filesystem and chain init it. The next stage init will recognize itself as the intended system and complete the system startup. The options are as follows:
- Write status updates to the terminal only about failed daemons. This behavior is the default.
- Never write status updates about daemons to the terminal.
- Boot default-daemon as the target. The default daemon configuration is changed to only require the default-daemon dependency with the exit-only flag.
- Write all status updates about daemons starting and stopping to the terminal
initdeletes everything inside of /tmp if it exists, otherwise it is created with mode 1777.
initcreates /var with mode 755 if it doesn't exist.
initdeletes everything inside of /var/run if it exists, otherwise it is created with mode 755.
initwill scan every block device for valid partition tables and create the corresponding partition devices in /dev. /etc/fstab (see fstab(5)). This configuration file is a copy of the real file made by update-initrd(8) when it makes the bootstrap initrd(7). The root filesystem is found by searching each block device and partition. It is checked for consistency if necessary and mounted read-only if the check fails. It is mounted at /tmp/fs.XXXXXX and the /dev filesystem directory is bound at /tmp/fs.XXXXXX/dev. Finally the /sbin/init program (or chain-init if specified) of the target root filesystem is run inside a chroot. If the target is chain-merge, then the
--target=mergeoption is passed to the next
initmounts all the filesystems according to fstab(5). The filesystems are checked for consistency if necessary and mounted read-only if the check fails. /var/log begins once the filesystems are mounted and
initwrites the log entries from early boot to its /var/log/init.log.
initwill write 256 bytes of randomness to /boot/random.seed, which serves as the initial entropy for the kernel(7) on the next boot. The file is also written on system shutdown where the system has the most entropy.
initof the real root filesystem runs, it will process basic configuration files and apply them:
initexits with the same error code and the kernel shuts down the machine. The default daemon is meant to be a virtual daemon depending on a single top level daemon (the target), which provide the desired operating system functionality (e.g. booting to a single user shell or a multi user login screen). The daemons are configured per init(5) where /etc/init contains the installation's local configuration, which overrides the operating system's default configuration in /share/init. The daemons are started in order as their dependencies become ready and are stopped in order when they are no longer required. The local daemon is meant to start the installation's local daemon requirements.
initsets the following environment variables.
- root's home directory
init's process id
- root's shell
- Initial kernel entropy
- Daemon configuration for the local system (first in search path) (see init(5))
- Configuration for the default daemon (see init(5))
- Filesystem table (see fstab(5))
- Hostname (see hostname(5))
- Keyboard layout (see kblayout(5))
- Graphics resolution (see videomode(5))
- Default daemon configuration provided by the operating system (second in search path) (see init(5))
- Daemon log files (see init(5))
init's own log.
- Request system poweroff, normally sent by poweroff(8).
- Request system reboot, normally sent by reboot(8).
- Request system halt, normally sent by halt(8).
initexits 0 if the kernel should power off, exits 1 if the kernel should reboot, or exits 2 if the boot failed and the kernel should halt with a complaint about an
initfatality. Any other exit by the initial
initwill cause the kernel to halt with a complaint about an unexpected exit code.
initexits with the same exit status as its target session if it terminates normally. fstab(5), hostname(5), init(5), kblayout(5), videomode(5), daemon(7), initrd(7), kernel(7), halt(8), login(8), poweroff(8), reboot(8), sysmerge(8), update-initrd(8)
initand its arguments. Unprivileged users can change the kernel command line from the bootloader command line if it hasn't been password protected. Likewise unprivileged users can use their own replacement bootloader by booting a portable device under their control if the firmware configuration has not been password protected.
|October 5, 2015||Debian|