mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
2.1 KiB
2.1 KiB
Bootstrap
- Populate
/dev - Parse
/etc/finit.conf - Load all
.soplugins - Remount/Pivot
/to get R+W - Call 1st level hooks,
HOOK_ROOTFS_UP - Mount
/etc/fstaband swap, if available - Cleanup stale files from
/tmp/*et al - Enable SysV init signals
- Call 2nd level hooks,
HOOK_BASEFS_UP - Start all 'S' runlevel tasks and services
- Load kernel params from
/etc/sysctl.d/*.conf,/etc/sysctl.confet al. (Supports all locations that SysV init does.) - Set hostname and bring up loopback interface
- Call
networkscript, if set in/etc/finit.conf - Call 3rd level hooks,
HOOK_NETWORK_UP - Switch to the configured runlevel from
/etc/finit.conf, default 2. At every runlevel change all*.conffiles in/etc/finit.d/are (re)loaded and new services, tasks, and blocking run commands are started. Provided they are allowed in the new runlevel and all of their conditions, if any, are set. - Call 4th level hooks,
HOOK_SVC_UP - If
runparts <DIR>is set, run-parts(8) is called on<DIR> - Call
/etc/rc.local, if it exists and is an executable shell script - Call 5th level (last) hooks,
HOOK_SYSTEM_UP - Start TTYs defined in
/etc/finit.conf, or rescue on/dev/console
In (10) and (15) tasks and services defined in /etc/finit.conf are
started. Remember, all service and task stanzas are started in
parallel and run in sequence, and in the order listed. Hence, to
emulate a SysV /etc/init.d/rcS one could write a long file with only
run statements.
Notice the five hook points that are called at various point in the bootstrap process. This is where plugins can extend the boot in any way they please.
For instance, at HOOK_BASEFS_UP a plugin could read an XML file from a
USB stick, convert/copy its contents to the system's /etc/ directory,
well before all 'S' runlevel tasks are started. This could be used with
system images that are created read-only and all configuration is stored
on external media.