mirror of
https://github.com/troglobit/finit.git
synced 2026-10-25 12:04:36 +00:00
The syntax overview no longer describes a line-based format, since that is not what the rest of the documentation shows. It now covers the grammar, the two naming conventions, the nine aliases, and the leading '-' on a path, and it says plainly that both formats are still read and told apart per file by content. Without that, a reader with an existing configuration is left wondering what happened to it. service-opts.md was a list of modifiers to place between a directive and its command, so it needed rewriting rather than translating: there are no positions left to describe. It is now grouped by what the settings do. conditions.md needed correcting. It presented '!' as a condition prefix alongside '~'. It is neither a condition nor a negation, it is a flag on the block that means one thing on a service and another on a run or task, so it is spelled reload-signal and required here, and the page maps the old form to both. Two things the pages claimed are not true. The kill delay range is 1-300, not 1-60, and stop and reload scripts are no longer run without a timeout. ChangeLog.md keeps its line-based examples. Those sit in historical release entries, and rewriting them in a syntax that did not exist at the time would misdate the format. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
68 lines
2.3 KiB
Markdown
68 lines
2.3 KiB
Markdown
Rescue Mode
|
|
===========
|
|
|
|
Finit supports a rescue mode which is activated by the `rescue` option
|
|
on the kernel command line. See [cmdline docs](../cmdline.md) for how to
|
|
activate it.
|
|
|
|
This rescue mode can be disabled at configure time using:
|
|
|
|
configure --without-rescue
|
|
|
|
The rescue mode comes in two flavors; *traditional* and *fallback*.
|
|
|
|
> [!NOTE]
|
|
> In this mode `initctl` will not work. Use the `-f` flag to force
|
|
> `reboot`, `shutdown`, or `poweroff`.
|
|
|
|
Traditional
|
|
-----------
|
|
|
|
This is what most users expect. A very early maintenance login prompt,
|
|
served by the system `sulogin` program from util-linux, or BusyBox. If
|
|
that is not found in `$PATH`, the bundled `/libexec/finit/sulogin`
|
|
program is used instead. If a successful login is made, or if the user
|
|
exits (Ctrl-D), the rescue mode is ended and the system boots up
|
|
normally.
|
|
|
|
> [!WARNING]
|
|
> The bundled sulogin in Finit can at configure time be given another
|
|
> user than the default (root). If the sulogin user does not have a
|
|
> password, or __the account is locked__, the user is presented with a
|
|
> prompt: `"Press enter to enter maintenance mode."`, which will open
|
|
> up a root shell *without prompting for password*!
|
|
|
|
Fallback
|
|
--------
|
|
|
|
If no `sulogin` program is found, Finit tries to bring up as much of its
|
|
own functionality as possible, yet limiting many aspects, meaning; no
|
|
network, no `fsck` of file systems in `/etc/fstab`, no `/etc/rc.local`,
|
|
no `runparts`, and most plugins are skipped (except those that provide
|
|
functionality for the condition subsystem).
|
|
|
|
Instead of reading `/etc/finit.conf` et al, system configuration is read
|
|
from `/lib/finit/rescue.conf`, which can be freely modified by the
|
|
system administrator.
|
|
|
|
The bundled default `rescue.conf` contains nothing more than:
|
|
|
|
runlevel 1
|
|
tty rescue {
|
|
runlevel = "12345"
|
|
rescue = true
|
|
}
|
|
|
|
The `tty` has the `rescue` option set, which works similar to the board
|
|
bring-up tty option `notty`. The major difference being that `sulogin`
|
|
is started to query for root/admin password. If `sulogin` is not found,
|
|
`rescue` behaves like `notty` and gives a plain root shell prompt.
|
|
|
|
If Finit cannot find `/lib/finit/rescue.conf` it defaults to:
|
|
|
|
tty rescue {
|
|
runlevel = "12345"
|
|
rescue = true
|
|
}
|
|
|
|
There is no way to exit the *fallback* rescue mode. |