Files
Joachim Wiberg b9ad9bcb21 doc: convert the documentation to the block format
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>
2026-07-30 15:21:31 +02:00

1.1 KiB

Environment Variables

In Finit v4.3 support for setting environment variables in finit.conf, and any *.conf, was added. It is worth noting that these are global and shared with all services -- the only way to have a service-local environment is detailed in Services Environment.

Global environment variables go in an environment block, env for short:

environment {
    foo = "bar"
    baz = "qux"
}

On reload of .conf files, all tracked environment variables are cleared so if foo is removed from finit.conf, or any finit.d/*.conf file, it will no longer be used by Finit or any new (!) started run/tasks or services. The environment of already started processes can not be changed.

The only variables reset to sane defaults on .conf reload are:

PATH=_PATH_STDPATH
SHELL=_PATH_BSHELL
LOGNAME=root
USER=root

It is entirely possible to override these as well from the .conf files, but be careful. Changing SHELL changes the behavior of system() and a lot of other commands as well.