Releases: troglobit/finit
Finit v4.8
Changes
- Avoid remounting already mounted
/run
and/tmp
directories. This extends the existing support for detecting mounted directories to include complex mount hierarchies are in use, overlayfs and tmpfs mounts. Feature by Mathias Thore, Atlas Copco - getty: trigger /etc/issue compat mode for Alpine Linux
- tmpfiles.d: skip
x11.conf
unless X11 common plugin is enabled - tmpfiles.d: ignore x/X command, nos support for cleanup at runtime
- Drop debug mode
-D
fromudevd
inhotplug.conf.in
, allow the user to set this in/etc/default/udevd
instead - Certain initctl APIs at bootstrap are not supported, update warning log to include command (number) for troubleshooting, issue #398
- Add support for hwrng to urandom plugin and check for empty seed
- Add
runparts -b
(batch mode) support, disables escape sequences - New configure
--without-rc-local
, disables/etc/rc.local
support - New configure
--disable-cgroup
option, disables cgroup v2 detection initctl show template@foo.conf
now shows how an enabled template service has been evaluated by Finit, issue #411- Extend
initctl
timeout connecting and waiting for Finit reply. The previous 2 + 2 second poll timeout has proved to be too short on more complex systems. Now a 15 + 15 second timeout is applied which should be more resistant to temporary overload scenarios, issue #407
Fixes
- Fix #397: system shutdown/reboot can block on console input if action is started remotely (ssh). Caused by legact TTY screen size probing, removed from both bootstrap and shutdown/reboot
- Fix #400: both
HOOK_MOUNT_ERROR
andsulogin()
fail to trigger on either mount orfsck
errors. Problem caused by unresolved status from pipe, callingpclose()
without extracting exit status - Fix #402:
initctl touch
does not respect-n
(no error) flag - Fix #403:
initctl touch
does not support template services - Fix #404: possible undefined behavior when
--with-fstab=no
is set - Fix #405:
@console
getty does not work withtty0 ttyS0
- Fix #409: prevent tmpfiles from following symlinks for
L+
andR
, otherwise symlink targets would also be removed. Found and fixed by Mathias Thore and Ming Liu, Atlas Copco - Fix #414: Frr Zebra immediately restarts on
initctl stop zebra
. The fix likely works for all Frr/Quagga services due to the way they create and delete their pid file - Cosmetic issue with
[ OK ]
messages being printed out of order at shutdown/reboot. Caused by nested calls toservice_stop()
- Cosmetic issue with duplicate "Restoring RTC" message at bootstrap
Finit v4.7
Changes
- Silence "not available" messages for run/task/service with
nowarn
- Update docs,
cgroup.root
workaround forSCHED_RR
tasks - Drop runlevels 0 and 6 from
keventd
, not needed at reboot/poweroff - Mount
/dev/shm
with mode 1777 (sticky bit) - Mount
/dev/mqueue
if available, inspiration from Alpine Linux - Update Alpine Linux installer and configuration files, tested on
Alpine v3.19, some assembly still required
Fixes
- Fix confusing warning message when tmpfiles.d fails to install symlink
- Fix tmpfiles.d legacy
/run/lock/subsys
, ordering - Add missing
/var/tmp
and/var/lock -> /run/lock
(tmpfiles.d) - Fix #388: log redirection broken unless Finit runs in debug mode.
Found and fixed by Ryan Rorison - Fix #389: must libc requires
libgen.h
forbasename()
function.
Reported and worked around with newbasenm()
function by Stargirl - Fix #392:
service/foo/ready
condition reasserted on pidfile removal
Finit v4.6
Changes
- Add support for service
notify:pid
andreadiness none
global
option to change how Finit expects readiness notification, issue #386
Fixes
- Fix #383: dbus and runparts regression in Finit v4.5. The configure
script must expandFINIT_RUNPATH_
before defining it inconfig.h
- Fix #384: service environment variables drop everything but the first
argument, e.g.,VAR="foo bar qux"
drops everything butfoo
- Fix #385: internal conditions, e.g.,
<int/bootstrap>
turn into flux
when leaving bootstrap, causing depending services to stop - Fix #387: global environment variables declared with
set VAR=NAME
do
not drop leadingset
, causing'set VAR'='NAME'
in env. - Sanity check environment variables, for services and globally. Ensure
the variable name (key) does not contain spaces, or a leadingset
Finit v4.5
Changes
- Refactor
runparts
and/etc/rc.local
to no longer block the main loop, allowinginitctl
calls to interact with Finit. Issue #356 - Refactor the
run
stanza to no longer block the main loop, issue #362 - Allow
sulogin
with a user different fromroot
, issue #357 - Allow disabling invocation of rescue mode from kernel command line
- Add
initctl -f
to force-skip asking Finit for existing services when creating new services during bootstrap, e.g./etc/rc.local
initctl runlevel
now returnsN S
instead ofN 10
in bootstrapinitctl runlevel N
during bootstrap is now allowed. It changes the next runlevel to go to when bootstrap has completed. Effectively overriding therunlevel N
statement in/etc/finit.conf
- Improved logging on failure to
execvp()
a run/task/service, now witherrno
, e.g., "No such file or directory" when the command is missing from$PATH
- Add Bash completion support for
initctl
, configurable, issue #360 - Handle absolute path to
initctl [enable|disable]
, not supported - Update
finit.conf(5)
man page with the recommended directory hierarchy in/etc/finit.d/
- The
runparts
code has been split into/libexec/finit/runparts
- The
runparts
command now takes two options:sysv
andprogress
. The former ensures onlySNNfoo
andKNNfoo
scripts are run. - Add SysV Init Compatibility section to documentation
- Increased MAX path for commands, and arguments: 64 -> 256
- The bundled watchdog daemon no longer tries to log at startup, because syslog is not available yet, any startup message leak to console
- Extend
if:
option with runtime evaluation of conditions. E.g., start a task onlyif:<run/foo/failure>
(here the run task 'foo' failed) - Document new
if:
,conflict:
,nowarn
options for run/task/service first introduced in v4.4 - Failure to open fstab should log to console, not just log to
/dev/kmsg
- Rename
/lib/finit/system/*.conf
, added numbered prefix to ensure proper execution order, e.g.,udevd
should always run first - Plugins and bundled services: dbus, keventd, watchdogd, and runparts, are now loaded after all services in
/lib/finit/system/
. A new runtime-only path (for inspection) in/run/finit/system/
is used - Redirect
log*
output to console whenfinit.debug
is enabled - Assert
<int/container>
condition if we detect running in container - Add support for mdev's netlink daemon mode, issue #367
- Add support for mdevd in
10-hotplug.conf
, preferred over plain mdev - Disable modprobe plugin by default, udevd and mdev/mdevd loads modules
- Update documentation for run/task shell limitations, issue #376
- Update documentation regarding automount of
/run
and/tmp
- Update plugin documentation, add section about limited tmpfiles.d(5) support
- Skip registering service when
if:!name
matches a known service. This allows conditional loading of alternative services, e.g. if udevd is already loaded we do not need mdevd - Drop
doc/bootstrap.md
, inaccurate and confusing to users
Fixes
-
Fix #227: believed to have been fixed in v4.3, the root cause was actually that Finit was waiting for a process that was no longer in the system. The fix is to ask the kernel on process-stop-timeout and replay the lost PID so that Finit can continue with reboot/shutdown
-
Fix #358: fix inotify events for
/etc/finit.conf
, improved log messages and error handling -
Fix #361: cgroup move fail if run/task/services start as non-root. Regression in the v4.4 release cycle while adding support for the pre:/post:/ready: scripts. Now the latter scripts also properly run in their correct cgroup
-
Fix #366: document
fsck.*
kernel command line options and simplify the configure flags--enable-fsckfix
and--enable-fastboot
to only adjust the default values for thefsck.*
options. -
Fix #371: swap load order of
/lib/finit/system/*
vs/etc/finit.d/*
We must run10-hotplug.conf
first to ensure devices and modules are up and loaded before the user's run/task/services are called. The order at bootstrap is now saved in/run/finit/conf.order
for inspection,/run/finit/exec.order
shows the start order of each process -
Fix #372: lost
udevadm
calls due to overloading -
Adjust final
udevadm settle
timeout: 5 -> 30 sec -
Fixed dbus plugin, the function that located
<pidfile> ...
in thedbus/system.conf
caused spurious line breaks which led to the service not being loaded properly -
The
runparts
executor now skips backup files (foo~
) -
The
runparts
stanza now properly appendsstart
to scripts that start withS[0-9]+
. This has been broken for a very long time. -
Fix #377: expand service
env:file
variables, allow constructs like:RUNDIR=/var/run/somesvc DAEMON_ARGS=--workdir $RUNDIR --other-args...
-
Fix #378: warn on console if run/task times out during bootstrap
-
Fix #378: add run/task support for
<!>
to allow transition from bootstrap to multi-user runlevel even though task has not run yet. -
Fix #382: do not clear
<service/foo/STATE>
conditions on reload.
Introduced back in v4.3-rc2, 82cc10b, the support for automatic service conditions have had a weird and unintended behavior. Any change in state (seedoc/svc-machine.png
) caused Finit to clear out all previously acquired service conditions.However, when moving between RUNNING and PAUSED states, a service should not have its conditions cleared. The PAUSED state, seen also by all conditions moving to FLUX, is only temporary while an
initctl reload
is processed. If a service has no changes to be applied it will move back to RUNNING.Also, we cannot clear the service conditions because other run/task or services may depend on it and clearing them would cause Finit to
SIGTERM
these processes (since they are no longer eligible to run).
Finit v4.5-rc5
Changes
- Refactor
runparts
and/etc/rc.local
to no longer block the main
loop, allowinginitctl
calls to interact with Finit. Issue #356 - Refactor the
run
stanza to no longer block the main loop, issue #362 - Allow
sulogin
with a user different fromroot
, issue #357 - Allow disabling invocation of rescue mode from kernel command line
- Add
initctl -f
to force-skip asking Finit for existing services
when creating new services during bootstrap, e.g./etc/rc.local
initctl runlevel
now returnsN S
instead ofN 10
in bootstrapinitctl runlevel N
during bootstrap is now allowed. It changes
the next runlevel to go to when bootstrap has completed. Effectively
overriding therunlevel N
statement in/etc/finit.conf
- Improved logging on failure to
execvp()
a run/task/service, now
witherrno
, e.g., "No such file or directory" when the command
is missing from$PATH
- Add support for Bash completion to
initctl
, issue #360 - Handle absolute path to
initctl [enable|disable]
, not supported - Update
finit.conf(5)
man page with the recommended directory
hierarchy in/etc/finit.d/
- The
runparts
code has been split into/libexec/finit/runparts
- The
runparts
command now takes two options:sysv
andprogress
.
The former ensures onlySNNfoo
andKNNfoo
scripts are run. - Add SysV Init Compatibility section to documentation
- Increased MAX path for commands, and arguments: 64 -> 256
- The bundled watchdog daemon no longer tries to log at startup, because
syslog is not available yet, any startup message leak to console - Extend
if:
option with runtime evaluation of conditions. E.g., start
a task onlyif:<run/foo/failure>
(here the run task 'foo' failed) - Document new
if:
,conflict:
,nowarn
options for run/task/service
first introduced in v4.4 - Failure to open fstab should log to console, not just log to
/dev/kmsg
- Rename
/lib/finit/system/*.conf
, added numbered prefix to ensure
proper execution order, e.g.,udevd
should always run first - Plugins and bundled services: dbus, keventd, watchdogd, and runparts,
are now loaded after all services in/lib/finit/system/
. A new
runtime-only path (for inspection) in/run/finit/system/
is used
Fixes
- Fix #227: believed to have been fixed in v4.3, the root cause was
actually that Finit was waiting for a process that was no longer in
the system. The fix is to ask the kernel on process-stop-timeout and
replay the lost PID so that Finit can continue with reboot/shutdown - Fix #358: fix inotify events for
/etc/finit.conf
, improved log
messages and error handling - Fix #361: cgroup move fail if run/task/services start as non-root.
Regression in the v4.4 release cycle while adding support for the
pre:/post:/ready: scripts. Now the latter scripts also properly run
in their correct cgroup - Fix #366: document
fsck.*
kernel command line options and simplify
the configure flags--enable-fsckfix
and--enable-fastboot
to
only adjust the default values for thefsck.*
options. - Fix #371: swap load order of
/lib/finit/system/*
vs/etc/finit.d/*
We must run10-hotplug.conf
first to ensure devices and modules are
up and loaded before the user's run/task/services are called. The order
at bootstrap is now saved in/run/finit/conf.order
for inspection,
/run/finit/exec.order
shows the start order of each process - Fix #372: lost
udevadm
calls due to overloading - Fixed dbus plugin, the function that located
<pidfile> ...
in the
dbus/system.conf
caused spurious line breaks which led to the
service not being loaded properly - The
runparts
executor now skips backup files (foo~
) - The
runparts
stanza now properly appendsstart
to scripts that
start withS[0-9]+
. This has been broken for a very long time.
Finit v4.5-rc4
Changes
- Refactor
runparts
and/etc/rc.local
to no longer block the main
loop, allowinginitctl
calls to interact with Finit. Issue #356 - Refactor the
run
stanza to no longer block the main loop, issue #362 - Allow
sulogin
with a user different fromroot
, issue #357 - Allow disabling invocation of rescue mode from kernel command line
- Add
initctl -f
to force-skip asking Finit for existing services
when creating new services during bootstrap, e.g./etc/rc.local
initctl runlevel
now returnsN S
instead ofN 10
in bootstrapinitctl runlevel N
during bootstrap is now allowed. It changes
the next runlevel to go to when bootstrap has completed. Effectively
overriding therunlevel N
statement in/etc/finit.conf
- Improved logging on failure to
execvp()
a run/task/service, now
witherrno
, e.g., "No such file or directory" when the command
is missing from$PATH
- Add support for Bash completion to
initctl
, issue #360 - Handle absolute path to
initctl [enable|disable]
, not supported - Update
finit.conf(5)
man page with the recommended directory
hierarchy in/etc/finit.d/
- The
runparts
code has been split into/libexec/finit/runparts
- The
runparts
command now takes two options:sysv
andprogress
.
The former ensures onlySNNfoo
andKNNfoo
scripts are run. - Add SysV Init Compatibility section to documentation
- Increased MAX path for commands, and arguments: 64 -> 256
- The bundled watchdog daemon no longer tries to log at startup, because
syslog is not available yet, any startup message leak to console - Extend
if:
option with runtime evaluation of conditions. E.g., start
a task onlyif:<run/foo/failure>
(here the run task 'foo' failed) - Document new
if:
,conflict:
,nowarn
options for run/task/service
first introduced in v4.4
Fixes
- Fix #227: believed to have been fixed in v4.3, the root cause was
actually that Finit was waiting for a process that was no longer in
the system. The fix is to ask the kernel on process-stop-timeout and
replay the lost PID so that Finit can continue with reboot/shutdown - Fix #358: fix inotify events for
/etc/finit.conf
, improved log
messages and error handling - Fix #361: cgroup move fail if run/task/services start as non-root.
Regression in the v4.4 release cycle while adding support for the
pre:/post:/ready: scripts. Now the latter scripts also properly run
in their correct cgroup - Fix #366: document
fsck.*
kernel command line options and simplify
the configure flags--enable-fsckfix
and--enable-fastboot
to
only adjust the default values for thefsck.*
options. - The
runparts
executor now skips backup files (foo~
) - The
runparts
stanza now properly appendsstart
to scripts that
start withS[0-9]+
. This has been broken for a very long time.
Finit v4.5-rc3
Changes
- Refactor
runparts
and/etc/rc.local
to no longer block the main
loop, allowinginitctl
calls to interact with Finit. Issue #356 - Refactor the
run
stanza to no longer block the main loop, issue #362 - Allow
sulogin
with a user different fromroot
, issue #357 - Allow disabling invocation of rescue mode from kernel command line
- Add
initctl -f
to force-skip asking Finit for existing services
when creating new services during bootstrap, e.g./etc/rc.local
initctl runlevel
now returnsN S
instead ofN 10
in bootstrap- Improved logging on failure to
execvp()
a run/task/service, now
witherrno
, e.g., "No such file or directory" when the command
is missing from$PATH
- Add support for Bash completion to
initctl
, issue #360 - Handle absolute path to
initctl [enable|disable]
, not supported - Update
finit.conf(5)
man page with the recommended directory
hierarchy in/etc/finit.d/
- The
runparts
code has been split into/libexec/finit/runparts
- The
runparts
command now takes two options:sysv
andprogress
.
The former ensures onlySNNfoo
andKNNfoo
scripts are run. - Add SysV Init Compatibility section to documentation
- Increased MAX path for commands, and arguments: 64 -> 256
- The bundled watchdog daemon no longer tries to log at startup, because
syslog is not available yet, any startup message leak to console
Fixes
- Fix #227: believed to have been fixed in v4.3, the root cause was
actually that Finit was waiting for a process that was no longer in
the system. The fix is to ask the kernel on process-stop-timeout and
replay the lost PID so that Finit can continue with reboot/shutdown - Fix #358: fix inotify events for
/etc/finit.conf
, improved log
messages and error handling - Fix #361: cgroup move fail if run/task/services start as non-root.
Regression in the v4.4 release cycle while adding support for the
pre:/post:/ready: scripts. Now the latter scripts also properly run
in their correct cgroup - Fix #366: document
fsck.*
kernel command line options and simplify
the configure flags--enable-fsckfix
and--enable-fastboot
to
only adjust the default values for thefsck.*
options. - The
runparts
executor now skips backup files (foo~
) - The
runparts
stanza now properly appendsstart
to scripts that
start withS[0-9]+
. This has been broken for a very long time.
Finit v4.5-rc2
Changes
- Refactor
runparts
and/etc/rc.local
to no longer block the main loop, allowing these scripts to callinitctl
to interact with Finit. Still in a limited way due to them being used at bootstrap, issue #356 - Refactor the
run
stanza to no longer block the main loop, issue #362 - Allow
sulogin
with a user different fromroot
, issue #357 - Allow disabling invocation of rescue mode from kernel command line
- Add
initctl -f
to force-skip asking Finit for existing services when creating new services during bootstrap, e.g./etc/rc.local
initctl runlevel
now returnsN S
instead ofN 10
in bootstrap- Improved logging on failure to
execvp()
a run/task/service, now witherrno
, e.g., "No such file or directory" when the command is missing from$PATH
- Add support for Bash completion to
initctl
, issue #360 - Handle absolute path to
initctl [enable|disable]
, not supported - Update
finit.conf(5)
man page with the recommended directory hierarchy in/etc/finit.d/
- The
runparts
code has been split into/libexec/finit/runparts
- Add SysV Init Compatibility section to documentation
- Increased MAX path for commands, and arguments: 64 -> 256
Fixes
- Fix #227: believed to have been fixed in v4.3, the root cause was actually that Finit was waiting for a process that was no longer in the system. The fix is to ask the kernel on process-stop-timeout and replay the lost PID so that Finit can continue with reboot/shutdown
- Fix #358: fix inotify events for
/etc/finit.conf
, improved log messages and error handling - Fix #361: cgroup move fail if run/task/services start as non-root. Regression in the v4.4 release cycle while adding support for the pre:/post:/ready: scripts. Now the latter scripts also properly run in their correct cgroup
- The
runparts
executor now skips backup files (foo~
) - The
runparts
stanza now properly appendsstart
to scripts that start withS[0-9]+
. This has been broken for a very long time.
Finit v4.4
Note 1: this release contains changes to the
.conf
parser. If you have .conf file statements with comment character (#
) in the command options or description, you must now escape them (\#
). Issue #186Note 2: prior to this release, runlevel
S
and0
were after boot treated as the same runlevel. This causedtask [06] ...
to also run at bootstrap instead of just at shutdown and reboot. The changes made to Finit to separateS
from0
require you to update the allowed runlevels for services that are allowed to continue running at shutdown. I.e., change[S123456789]
to[S0123456789]
for, e.g.,sysklogd
. Issue #352
Changes
-
Add limited tmpfiles.d(5) support
This change adds very basic
tmpfiles.d/
support to Finit. Most of
the basic types are supported, but not all, so for now, please check
the code and examples for details on what is working. -
If a run/task/service command does not exist, skip registering it
This changes the semantics of Finit a bit by checking for the command
to run when registering it, skipping commands that cannot be found in
the absolute path provided in the command, or in$PATH
This change includes a new
nowarn
flag that can be used to prevent
Finit from warning for missing commands. See below for an example. -
Add run/task/service support for
conflict:foo
handling -
Add run/task/service support for
if:[!]ident
andif:<[!]cond>
Conditional loading of stanza depending on ident is already loaded (or
not), or condition satisfied (or not). E.g., do not runmdev
if we
found and registeredudevd
, or load service only if<boot/testing>
condition is set.The optional leading
!
negates the comparison, if NOT foo then ... -
Add support for static services in
/lib/finit/system/*.conf
Slowly migrating away from hard-coded services in plugins. This way
it's possible for the user to both inspect and override as needed. -
Migrate hotplug plugin to a conditional
/lib/finit/system/hotplug.conf
This is the first example of the just minted advanced stanza syntax with
if:
-statements,conflict:
handling, andnowarn
flags. -
Initial support for template services,
foo@.conf
, similar to systemd$ initctl show avahi-autoipd@ service :%i avahi-autoipd --syslog %i -- ZeroConf for %i
To enable ZeroConf for, e.g.,
eth0
, use$ initctl enable avahi-autoipd@eth0.conf
The enabled symlink will be set up to
avahi-autoipd@.conf
and every
instance of%i
will in the instantiated directive be replaced with
eth0
. Inspect the result with:$ initctl status avahi-autoipd:eth0
-
Add
devmon
, a<dev/foo>
condition provider, issue #185 -
Support for line continuation character
\
in .conf files, issue #186service name:sysklogd [S123456789] \ env:-/etc/default/sysklogd \ syslogd -F $SYSLOGD_ARGS \ -- System log daemon
-
HOOK_BASEFS_UP
has been moved! External plugins that need to call
service_register()
, please useHOOK_SVC_PLUGIN
from now on.
Apologies for any inconveniences this might cause! -
getty: add support for
/etc/os-release
to replaceuname
output
This change, which has a fallback to/usr/lib/os-release
, overrides
traditional modifiers with the os-release variant. These values were
taken fromuname
, which on Linux systems are pretty useless since
they always return the kernel name and version instead of the
distro/OS values.E.g., \s becomes
PRETTY_NAME
instead of 'Linux' and \v becomes the
prettyVERSION
, while \r becomesVERSION_ID
. -
Support for overriding
/etc/finit.conf
and/etc/finit.d
issue #235
New (kernel) command line optionfinit.config=PATH
which can be used
to redirect Finit to start up with, e.g.,/etc/factory.conf
instead of
/etc/finit.conf
.For the complete experience a new top-level configuration file directive
rcsd PATH
has aslo been added. It in turn can be used byfactory.conf
as follows to override/etc/finit.d
:rcsd /etc/factory.d
-
Support for overriding
/etc/finit.d
from the alternatefinit.conf
with a newrcsd /path/to/dot.d/
.conf file directive -
Support for
fsck_mode=[auto,skip,force]
+fsck_repair=[preen,no,yes]
-
Add
set
keyword for environment variables set in/etc/finit.conf
-
Support
finit.cond=foo
cmdline<boot/foo>
conditions, issue #250 -
initctl
JSON output support for status and conditions, issue #273
Example:root@infix:~$ initctl status -j resolvconf { "identity": "resolvconf", "description": "Update DNS configuration", "type": "task", "forking": false, "status": "done", "exit": { "code": 0 }, "origin": "/etc/finit.d/enabled/sysrepo.conf", "command": "resolvconf -u", "restarts": 0, "pidfile": "none", "pid": 0, "user": "root", "group": "root", "uptime": 0, "runlevels": [ 1, 2, 3, 4, 5, 7, 8, 9 ] }
The excellent tool
jq
can be used to extract parts of the output for
further scripting. E.g.initctl status -j foo | jq .exit.status
-
Add JSON support to
initctl ls
commandThis allows for easy access to the disabled services:
root@anarchy:~# initctl ls --json |jq '.available - .enabled' [ "chronyd.conf", "dnsmasq.conf", "gdbserver.conf", "inadyn.conf", "inetd.conf", "isisd.conf", "lldpd.conf", "mstpd.conf", "ntpd.conf", "ospf6d.conf", "ospfd.conf", "querierd.conf", "ripd.conf", "ripng.conf", "sshd.conf", "syslogd.conf", "telnetd.conf", "uftpd.conf", "wpa_supplicant.conf", "zebra.conf" ]
-
Allow
manual:yes
on sysv/service/run/task stanzas, issue #274 -
Add support for
oncrash:script
to call thepost:script
action, if
defined, for a crashing service. TheEXIT_CODE
variable sent to the
script is set tocrashed
. Issue #282 -
Search for plugins in
/usr
and/usr/local
as well, issue #284 -
tty: add support for
passenv
flag to/bin/login
, issue #286 -
Add reboot/shutdown/poweroff timeout
-t SEC
to initctl, issue #295 -
Add support for s6 and systemd readiness notification, issue #299.
Service readiness notification to support daemons employing systemd
and s6 notification. Complementing the native Finit readiness support
using PID files that exist already.The two have slightly different ways of implementing readiness:
- https://www.freedesktop.org/software/systemd/man/sd_notify.html
- https://skarnet.org/software/s6/notifywhenup.html
Finit now provides both a
NOTIFY_SOCKET
environment variable, for
systemd, and a way to start s6 daemons with a descriptor argument.For details on the syntax, see the
service
documentation.This change also renames internal states for run/task/services to
avoid any confusion with the introduction ofready:scripts
:WAITING -> PAUSED
READY -> WAITING
A service condition that used, e.g.,
<service/foo/ready>
should now
instead use<service/foo/waiting>
-
Add
ready:script
for services, called when daemon is ready, issue #300 -
Add support for running scripts at shutdown at two new hook points
during the shutdown process, issue #302. See doc/plugins.md for details:HOOK_SVC_DN
: after all services and non-reserved processes have been
killed (and collected)HOOK_SYS_DN
: after all file systems have been unmounted, just prior
to Finit callingreboot()
to shut down or reboot the system
-
The
modules-load
plugin now default to runlevel[S]
, in previous
releases it was[2345]
. This breaking change is to align it more
with what users mostly want (modules loaded before services start) and
can be changed back to the old behavior with a per-file setting:set runlevel 2345
-
The
modules-load
plugin now adds silent tasks for modprobe. This to
prevent confusing[ OK ]
boot messages when in fact modprobe failed. -
The
modules-load
plugin now supportset modprobe /path/to/modprobe
-
The header files
finit/conf.h
andfinit/service.h
are now exported
for external plugins -
Add support for multiple args to
initctl cond set/clr
, issue #329 -
Silence confusing
[ OK ]
progress from modules-load plugin, issue #332This change drops the confusing status progress output, which was always
OK since the actual modprobe operation runs in the background. No need
to show status of the "added a task to finit, found modprobe" command. -
dbus plugin: adapt to other operating systems
Not all Linux systems are based on Debian, and even if they are inspired
by Debian (Buildroot), they do not necessarily use the same defaults.
Probes the system at runtime for:- dbus user and group
- dbus PID file
If the user/group cannot be found we fall back to
root
, if the PID
file cannot be determined we ignore PID file readiness. -
Improve documentation for runparts and hook scripts. Issue #315, #320
-
Add
HOOK_NETWORK_DN
, called after change to runlevel 6 or 0, issue #319 -
Use sysklogd
logger
tool instead of legacylogit
tool, issue #344For log redirection Finit has the legacy
logit
tool. This change
allows Finit to use thesysklogd
project's extendedlogger
tool
instead, when available. Allowing logging with the process' PID. -
Add
initctl
aliases:cat -> show
,kill -> signal
-
Add
initctl -n,--noerr
to return ...
Finit v4.4-rc2
Note 1: this release contains changes to the
.conf
parser. If you
have .conf file statements with comment character (#
) in the command
options or description, you must now escape them (\#
). Issue #186Note 2: prior to this release, runlevel
S
and0
were after
boot treated as the same runlevel. This causedtask [06] ...
to
also run at bootstrap instead of just at shutdown and reboot. The
changes made to Finit to separateS
from0
require you to update
the allowed runlevels for services that are allowed to continue
running at shutdown. I.e., change[S123456789]
to[S0123456789]
for, e.g.,sysklogd
. Issue #352
Changes
-
Add limited tmpfiles.d(5) support
This change adds very basic
tmpfiles.d/
support to Finit. Most of
the basic types are supported, but not all, so for now, please check
the code and examples for details on what is working. -
If a run/task/service command does not exist, skip registering it
This changes the semantics of Finit a bit by checking for the command
to run when registering it, skipping commands that cannot be found in
the absolute path provided in the command, or in$PATH
This change includes a new
nowarn
flag that can be used to prevent
Finit from warning for missing commands. See below for an example. -
Add run/task/service support for
conflict:foo
handling -
Add run/task/service support for
if:[!]ident
andif:<[!]cond>
Conditional loading of stanza depending on ident is already loaded (or
not), or condition satisfied (or not). E.g., do not runmdev
if we
found and registeredudevd
, or load service only if<boot/testing>
condition is set.The optional leading
!
negates the comparison, if NOT foo then ... -
Add support for static services in
/lib/finit/system/*.conf
Slowly migrating away from hard-coded services in plugins. This way
it's possible for the user to both inspect and override as needed. -
Migrate hotplug plugin to a conditional
/lib/finit/system/hotplug.conf
This is the first example of the just minted advanced stanza syntax with
if:
-statements,conflict:
handling, andnowarn
flags. -
Initial support for template services,
foo@.conf
, similar to systemd$ initctl show avahi-autoipd@ service :%i avahi-autoipd --syslog %i -- ZeroConf for %i
To enable ZeroConf for, e.g.,
eth0
, use$ initctl enable avahi-autoipd@eth0.conf
The enabled symlink will be set up to
avahi-autoipd@.conf
and every
instance of%i
will in the instantiated directive be replaced with
eth0
. Inspect the result with:$ initctl status avahi-autoipd:eth0
-
Add
devmon
, a<dev/foo>
condition provider, issue #185 -
Support for line continuation character
\
in .conf files, issue #186service name:sysklogd [S123456789] \ env:-/etc/default/sysklogd \ syslogd -F $SYSLOGD_ARGS \ -- System log daemon
-
HOOK_BASEFS_UP
has been moved! External plugins that need to call
service_register()
, please useHOOK_SVC_PLUGIN
from now on.
Apologies for any inconveniences this might cause! -
getty: add support for
/etc/os-release
to replaceuname
output
This change, which has a fallback to/usr/lib/os-release
, overrides
traditional modifiers with the os-release variant. These values were
taken fromuname
, which on Linux systems are pretty useless since
they always return the kernel name and version instead of the
distro/OS values.E.g., \s becomes
PRETTY_NAME
instead of 'Linux' and \v becomes the
prettyVERSION
, while \r becomesVERSION_ID
. -
Support for overriding
/etc/finit.conf
and/etc/finit.d
issue #235
New (kernel) command line optionfinit.config=PATH
which can be used
to redirect Finit to start up with, e.g.,/etc/factory.conf
instead of
/etc/finit.conf
.For the complete experience a new top-level configuration file directive
rcsd PATH
has aslo been added. It in turn can be used byfactory.conf
as follows to override/etc/finit.d
:rcsd /etc/factory.d
-
Support for overriding
/etc/finit.d
from the alternatefinit.conf
with a newrcsd /path/to/dot.d/
.conf file directive -
Support for
fsck_mode=[auto,skip,force]
+fsck_repair=[preen,no,yes]
-
Add
set
keyword for environment variables set in/etc/finit.conf
-
Support
finit.cond=foo
cmdline<boot/foo>
conditions, issue #250 -
initctl
JSON output support for status and conditions, issue #273
Example:root@infix:~$ initctl status -j resolvconf { "identity": "resolvconf", "description": "Update DNS configuration", "type": "task", "forking": false, "status": "done", "exit": { "code": 0 }, "origin": "/etc/finit.d/enabled/sysrepo.conf", "command": "resolvconf -u", "restarts": 0, "pidfile": "none", "pid": 0, "user": "root", "group": "root", "uptime": 0, "runlevels": [ 1, 2, 3, 4, 5, 7, 8, 9 ] }
The excellent tool
jq
can be used to extract parts of the output for
further scripting. E.g.initctl status -j foo | jq .exit.status
-
Add JSON support to
initctl ls
commandThis allows for easy access to the disabled services:
root@anarchy:~# initctl ls --json |jq '.available - .enabled' [ "chronyd.conf", "dnsmasq.conf", "gdbserver.conf", "inadyn.conf", "inetd.conf", "isisd.conf", "lldpd.conf", "mstpd.conf", "ntpd.conf", "ospf6d.conf", "ospfd.conf", "querierd.conf", "ripd.conf", "ripng.conf", "sshd.conf", "syslogd.conf", "telnetd.conf", "uftpd.conf", "wpa_supplicant.conf", "zebra.conf" ]
-
Allow
manual:yes
on sysv/service/run/task stanzas, issue #274 -
Add support for
oncrash:script
to call thepost:script
action, if
defined, for a crashing service. TheEXIT_CODE
variable sent to the
script is set tocrashed
. Issue #282 -
Search for plugins in
/usr
and/usr/local
as well, issue #284 -
tty: add support for
passenv
flag to/bin/login
, issue #286 -
Add reboot/shutdown/poweroff timeout
-t SEC
to initctl, issue #295 -
Add support for s6 and systemd readiness notification, issue #299.
Service readiness notification to support daemons employing systemd
and s6 notification. Complementing the native Finit readiness support
using PID files that exist already.The two have slightly different ways of implementing readiness:
- https://www.freedesktop.org/software/systemd/man/sd_notify.html
- https://skarnet.org/software/s6/notifywhenup.html
Finit now provides both a
NOTIFY_SOCKET
environment variable, for
systemd, and a way to start s6 daemons with a descriptor argument.For details on the syntax, see the
service
documentation.This change also renames internal states for run/task/services to
avoid any confusion with the introduction ofready:scripts
:WAITING -> PAUSED
READY -> WAITING
A service condition that used, e.g.,
<service/foo/ready>
should now
instead use<service/foo/waiting>
-
Add
ready:script
for services, called when daemon is ready, issue #300 -
Add support for running scripts at shutdown at two new hook points
during the shutdown process, issue #302. See doc/plugins.md for details:HOOK_SVC_DN
: after all services and non-reserved processes have been
killed (and collected)HOOK_SYS_DN
: after all file systems have been unmounted, just prior
to Finit callingreboot()
to shut down or reboot the system
-
The
modules-load
plugin now default to runlevel[S]
, in previous
releases it was[2345]
. This breaking change is to align it more
with what users mostly want (modules loaded before services start) and
can be changed back to the old behavior with a per-file setting:set runlevel 2345
-
The
modules-load
plugin now adds silent tasks for modprobe. This to
prevent confusing[ OK ]
boot messages when in fact modprobe failed. -
The
modules-load
plugin now supportset modprobe /path/to/modprobe
-
The header files
finit/conf.h
andfinit/service.h
are now exported
for external plugins -
Add support for multiple args to
initctl cond set/clr
, issue #329 -
Silence confusing
[ OK ]
progress from modules-load plugin, issue #332This change drops the confusing status progress output, which was always
OK since the actual modprobe operation runs in the background. No need
to show status of the "added a task to finit, found modprobe" command. -
dbus plugin: adapt to other operating systems
Not all Linux systems are based on Debian, and even if they are inspired
by Debian (Buildroot), they do not necessarily use the same defaults.
Probes the system at runtime for:- dbus user and group
- dbus PID file
If the user/group cannot be found we fall back to
root
, if the PID
file cannot be determined we ignore PID file readiness. -
Improve documentation for runparts and hook scripts. Issue #315, #320
-
Add
HOOK_NETWORK_DN
, called after change to runlevel 6 or 0, issue #319 -
Use sysklogd
logger
tool instead of legacylogit
tool, issue #344For log redirection Finit has the legacy
logit
tool. This change
allows Finit to use thesysklogd
project's extendedlogger
tool
instead, when available. Allowing logging with the process' PID. -
Add
initctl
aliases:cat -> show
,kill -> signal
-
Add `initct...