Sortix cisortix manual
This manual documents Sortix cisortix. You can instead view this document in the latest official manual.
NAME
init — system initializationSYNOPSIS
init | [-qsv] [--target=default-daemon] [--] [chain-init ...] |
DESCRIPTION
init is the first program run after system startup and is responsible for initializing the operating system.- -q, --quiet
- Write status updates to the terminal only about failed daemons. This behavior is the default.
- -s, --silent
- Never write status updates about daemons to the terminal.
- -t, --target=default-daemon
- Boot default-daemon as the target. The default daemon configuration is changed to only require the default-daemon dependency with the exit-only flag.
- -v, --verbose
- Write all status updates about daemons starting and stopping to the terminal
Cleanup of /tmp and /var/run
init deletes everything inside of /tmp if it exists, otherwise it is created with mode 1777.Partition Creation
init will scan every block device for valid partition tables and create the corresponding partition devices in /dev.Chain Initialization
If the target is chain or chain-merge, then the real operating system is chain initialized.Mountpoints
init mounts all the filesystems according to fstab(5). The filesystems are checked for consistency if necessary and mounted read-only if the check fails.Logging
Logging to /var/log begins once the filesystems are mounted and init writes the log entries from early boot to its /var/log/init.log.Random Seed
init will 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.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))
Merge
If the target is merge, then a delayed system upgrade is completed by invoking sysmerge(8) at /sysmerge/sbin/sysmerge with the --booting option.Daemons
The default daemon(7) is started per its /etc/init/default init(5) configuration file, which constitutes the operating system, and once it exits then init exits 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).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
- /boot/random.seed
- Initial kernel entropy
- /etc/init/
- Daemon configuration for the local system (first in search path) (see init(5))
- /etc/init/default
- Configuration for the default daemon (see init(5))
- /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))
- /share/init/
- Default daemon configuration provided by the operating system (second in search path) (see init(5))
- /var/log/
- Daemon log files (see init(5))
- /var/log/init.log
- init's own log.
ASYNCHRONOUS EVENTS
- SIGTERM
- Request system poweroff, normally sent by poweroff(8).
- SIGINT
- Request system reboot, normally sent by reboot(8).
- SIGQUIT
- Request system halt, normally sent by halt(8).