| FINIT(8) | System Manager's Manual (smm) | FINIT(8) |
finit — Fast init
for Linux systems
/sbin/finit |
[--] [debug] [finit.cond=foo[,bar[,baz]]] [finit.config=/path/to/alt/finit.conf] [finit.debug] [finit.fstab=/etc/fstab.alt] [finit.status=<on,off>] [finit.status_style=<classic,modern>] [loglevel=<0-7>] [panic=SEC] [quiet] [rescue | recover] [single | S] |
/sbin/telinit |
[-hv] [q | Q | 0-9] |
Fast init for Linux systems. Reverse engineered from the EeePC fastinit, 10+ years ago by Claudio Matsuoka, "gaps filled with frog DNA ...". Focus is on small and embedded systems, although Finit is fully usable on server and desktop systems as well.
Features include:
sd_notify() and s6 notification is also
supported.finit support the following command line
parameters to alter the behavior at boot. Notice the
-- separator needed to tell the kernel which
paramters should be given to PID 1. For more information on this, and
available kernel command line options, see
bootparam(7).
debugloglevel=7 (below) is used.finit.cond=foo[,bar[,baz]]<boot/foo> condition, optionally
multiple conditions can be set using the same option, separated with a
comma. Alternatively, multiple foo.cond=arg can be
given. Each will result in a <boot/arg>
condition being set to control the rest of the system bootstrap.
Very useful for selecting different boot modes, e.g. manufacturing test, firmware upgrade, or rescue mode.
Note:
<boot/...> conditions cannot be cleared
with initctl!
finit.config=/path/to/alternative/finit.confrcsd /path/to/finit.d to
override the default rcS.d directory.finit.debugfinit.fstab=/path/to/fstab.altfinit to use an alternate
fstab to mount the file system from. Remember,
this file must be on the root=... file system
provided to Finit from the kernel. If this file is missing,
finit falls back to its built-in default, which
can be changed at build time using the
--with-fstab=/path/to/footab configure option. It
is even possible to completely disable the built-in using
--without-fstab, meaning
finit
must be
started with the finit.fstab option.
Should finit discover that there is no
fstab file available, including the fallback, it triggers the same
failure mode as when fsck fails, starting
sulogin(8), if that is availble. When
sulogin is missing, or when the user exits from
sulogin, the system is rebooted.
Default fstab, unless changed at build-time: /etc/fstab
finit.status=<on,off>finit.show_status, which still works but is
deprecated.finit.status_style=<classic,modern>loglevel=<0-7>debug. Also, when
loglevel=7, Finit will
not
disable kernel logs to the console. This is very useful when
debugging the kernel at system bring-up. Since
loglevel=7 is the same as
debug this means you have to use
quiet for a quiet boot, until sysklogd takes over
logging of kernel events.panic=SECquietloglevel and quiet
above.rescue
|
recoversulogin program (Finit, or from
util-linux/Busybox), you will be given a root login to a maintenance
shell. However, if sulogin is missing, the file
/lib/finit/rescue.conf is read and the system
booted in a limited fallback mode. See finit.conf(5) for
more information.single
| S[1]
will be started, e.g., a tty [1] @console nologin
configuration presents you with a root console without login.
Note: by definition, single user mode does not have networking enabled. This is also true for runlevel 1.
Before laucnhing services, the system needs to be bootstrapped.
This involves mounting all filesystems (not already mounted by an initramfs)
in /etc/fstab, or any alternate
fstab file provided on the Finit command line using
finit.fstab, ensuring that necessary filesystems
like: /dev, /proc,
/sys, and /run are available
and can provide the system with the services required.
With that out of the way, a set of plugins take over:
bootmisc.somodprobe.soprocps.soWhen the plugins are done, finit reads /etc/finit.conf and all other enabled services in /etc/finit.d/*. First all services, run/tasks in runlevel S (bootStrap) are started, When all run/tasks have completed, Finit changes to the configured runlevel (default 2), Processes are started in parallel, in dependency order according to their conditions.
When all services and run/tasks have been started, the console progress is disabled and all configured getty services are started.
The condition subysystem in Finit was initially created to track PID files of daemons. If service/task B requires service A to have started, Finit waits for the PID file of service A to be created/updated before it starts service B. Conversely, if service A is stopped and its PID file removed, service B is also stopped.
The following condition families are available today:
netpidname:id, gives the condition pid/name:idserviceservice/foo/ready can be used as a condition for
service bar, provided foo
properly signals its readiness to Finit.sysusrinitctl cond
[set|clr] fooPID 1 is the only process that by default blocks all signals. Finit allows for the following signals to control operation, but recommends instead using the initctl(8) tool.
finit to reload its configuration file(s),
same as initctl reloadinitctl) socket.finit to perform a system shutdown, same as
initctl poweroffinitctl
rebootfinit was conceived and reverse engineered
by Claudio Matsuoka. Since v1.0, maintained by Joachim Wiberg, with
contributions by many others.
| April 22, 2023 | Linux |