Bot releases are visible (Hide)
Published by troglobit over 3 years ago
This is a pre-release, for internal testing at Westermo at the moment. Version 4.0 replaces the previously planned 3.2 because of major changes, for instance; removal of the built-in inetd, incompatible changes to kernel command options and configure script. See the changelog for more detailed information. A fully up-to-date list of changes is expected for the GA release.
Published by troglobit over 4 years ago
Fixes to condition handling and changes to condition names when :ID is set.
See 9d9b6b5 for a summary.
Published by troglobit over 4 years ago
Bug fix release, but also cgroups and a new progress!
https://twitter.com/b0rk/status/1214341831049252870?s=20
sysv
start/stop scripts as well as monitoring forking services, stared using sysv
or service
stanzakill:DELAY
, default 3 sec.halt:SIGNAL
, default SIGTERMpid:!/path/to/foo.pid
, useful with new sysv
or service
which fork to background$PATH
--disable-docs
and --disable-contrib
to speed up builds and work around issue with massively parallel builds@console
also for external getty-b
, batch mode, for non-interactive use to initctl
/dev/
if mdev is also available$SHELL
, like $PATH
, to a sane default value, needed by BusyBox*.conf
files after running /etc/rc.local
or run-parts. Use initctl reload
instead.initctl
without an argument or option now defaults to list servicessvc_t
and not PIDHOOK_SVC_START
and HOOK_SVC_LOST
, caused more problems than they were worth. Users are encouraged to use accounting insteadsvc_t
until any SIGKILL
timer has elapseduev_init1()
to reduce event cache so that the kernel can invalidate deleted events before enqueing to userspacehwclock.so
plugin to rtc.so
since it now is stand-alone from the hwclock
tool. Note: the kernel can also be set to load and store RTC to/from system clock at boot/halt as well, issue #110/sys/devices/*
/etc/modules-load.d/
by Robert Andersson, Atlas Copconame:foo
support for services, by Robert Andersson, Atlas Copcomanual:yes
support for services, by Robert Andersson, Atlas Copcolog:console
support for services, by Robert Andersson, Atlas Copco:ID
as a string, by Jonas Johansson, Westermoinitctl reload
, when a service configuration has changed. Disabled by default, but can be enabled with ./configure --enable-auto-reload
--disable-inetd
SIGKILL
inetd services, they are not backed by a PID. This caused a use after free issue crashing finit. Found and fixed by Tobias Waldekranz, Westermo/var/run
does not yet exist (symlink to /run
). Added compat layer for access@console
resolves to >1 TTY,/var/run
stdin
to /dev/null
for services by defaultnanosleep()
to achieve "signal safe" sleep, fixed by Jacques de Laval, Westermologit
processes when parent dies/bin/sh -c foo
just like the standard run-parts tool. Found by Magnus Malm, Westermoinitctl [start | restart]
, should behave the same for services that have crashed. Found by Mattias Walström, WestermoPublished by troglobit about 6 years ago
Bug fix release.
--disable-docs
and --disable-contrib
to speed up builds and work around issue with massively parallel builds-b
, batch mode, for non-interactive use to initctl
/dev/
if mdev is also available$SHELL
, like $PATH
, to a sane default value, needed by BusyBox*.conf
files after running /etc/rc.local
or run-parts. Use initctl reload
instead.initctl
without an argument or option now defaults to list servicessvc_t
and not PIDHOOK_SVC_START
and HOOK_SVC_LOST
, caused more problems than they were worth. Users are encouraged to use accounting insteadsvc_t
until any SIGKILL
timer has elapseduev_init1()
to reduce event cache so that the kernel can invalidate deleted events before enqueing to userspace--disable-inetd
SIGKILL
inetd services, they are not backed by a PID. This caused a use after free issue crashing finit. Found and fixed by Tobias Waldekranz, @wkz, Westermo/var/run
does not yet exist (symlink to /run
). Added compat layer for access@console
resolves to >1 TTYinitctl [start | restart]
, should behave the same for services that have crashed. Found by Mattias Walström, @mattiaswal, WestermoPublished by troglobit over 6 years ago
Improvements to netlink.so
plugin, per-service rlimit
support, improved integration with watchdogd, auto-detect TTY console. Much improved debug, rescue and logging support. Also, many fixes to both big and small issues, most notably in the condition handling, which no longer is sensitive to time skips.
This version requires at least libuEv v2.1.0 and libite v2.0.1
--debug
but also enable kernel debugIFF_RUNNING
to netlink plugin => net/IFNAME/running
initctl
API socket on SIGHUP
initctl status <JOB|NAME>
commandrlimit
per service/run/task/inetd/tty, issue #45hard
and soft
rlimit for a resource at oncetty @console
eliminates the need to keep track of different console devices across embedded platforms: /dev/ttyS0
, /dev/ttyAMA0
, etc.nologin
option. Bypasses login and skips immediately to a root shell. Useful during board bringup, in developer builds, etc.console DEV
settingPress enter to ...
prompt will now replace that line with the login issue textinitctl
without any arguments or options now defaults to show status of all enabled services, and run/task/inetd jobsLoading plugins ...
, start of inetd services, and Loading configuration ...
. No end user knows what those plugins and configurations are, i.e. internal state+configSIGPWR
and then SIGTERM
. It is recommended the daemon start a timer on the first signal, in case the shutdown process somehow hangs./etc/
OverlayFS, reload /etc/finit.d/*.conf after mount -a
initctl touch <CONF>
to be used with reload
initctl show <SVC>
/etc/finit.conf
. The main finit.conf file previously did not support reloading at runtime, as of v3.1 all configuration directives supported in /etc/finit.d/*.conf
are now supported in /etc/finit.conf
.conf
dependency + reload handling. Finit no longer relies on mtime of .conf
files, instead an inotify handler tracks file changes for time insensitive dependency tracking--enable-redirect
to automatically redirect stdout
and stderr
of all applications to /dev/null
pid
sub-option to services when a service does not create a PID file, or when the PID file has another name. Issue #95log
sub-option to service/run/tasks, selectively redirect stdout
and stderr
using the new tool logit
to either syslog or a logfile. Issue #44log
option. Use configure --disable-logrotate
on systems with a dedicated log rotation service. Issue #44 --
description. Note: no description separator gives a default desc./etc/mtab
symlink if missing on system (bootmisc plugin)hook/mount/post
runs after mount -a
but before the hook/mount/all
, where bootmisc.so
runs. This provides the possibility of running a second stage mount command before files in /run
and similar are createdgdbserver
when unleashing the grim reaper at shutdowndocs/
and contrib/
directories[S]
with a condition <...>
failed to run. Finit now tracks run/tasks more carefully, waiting for them to finish before switching to the configured runlevel at boot. Issue #86:161
, issue #87. Found by WestermoHOOK_SVC_RECONF
eventskill(0, SIGKILL)
initctl show
initctl
with STDOUT
redirectedinitctl start/stop <ID>
, using name worked not idinitctl start/stop
without any argument--debug
/run
instead of /var/run
Published by troglobit almost 7 years ago
--debug
but also enable kernel debugIFF_RUNNING
to netlink plugin => net/IFNAME/running
initctl
API socket on SIGHUP
initctl status <JOB|NAME>
commandhard
and soft
rlimit for a resource at oncenologin
to tty configurations, skips the login prompt and skips immediately to a root shell. Useful during board bringup, in developer builds, etc. Be careful though ...SIGPWR
and then SIGTERM
. It is recommended the daemon start a timer on the first signal, in case the shutdown process somehow hangs.--enable-redirect
to automatically redirect stdout
and stderr
of all applications to /dev/null
pid
sub-option to services when a service does not create a PID file, or when the PID file has another name. Issue #95log
sub-option to service/run/task to selectively redirect stdout
and stderr
using the new tool logit
to either syslog or a logfile. Issue #44finit-3.1-rc2.tar.xz Distribution tarball
finit-3.1-rc2.tar.xz.md5 595f2eea6bfe11c0c61a2c18c0141b3f
Published by troglobit almost 7 years ago
Finit v3.1 require libuEv v2.1.0, or later, and libite v2.0.1, or later.
rlimit
per service/run/task/inetd/tty, issue #45tty @console
eliminates the need to keep track of different console devices across embedded platforms: /dev/ttyS0
, /dev/ttyAMA0
, etc.console DEV
settingPress enter to ...
prompt will now replace that line with the login issue textinitctl
without any arguments or options now defaults to show status of all enabled services, and run/task/inetd jobsLoading plugins ...
, start of inetd services, and Loading configuration ...
. No end user knows what those plugins and configurations are, i.e. internal state+config/etc/
OverlayFS, reload /etc/finit.d/*.conf after mount -a
initctl touch <CONF>
to be used with reload
initctl show <SVC>
/etc/finit.conf
. The main finit.conf file previously did not support reloading at runtime, as of v3.1 all configuration directives supported in /etc/finit.d/*.conf
are now supported in /etc/finit.conf
.conf
dependency + reload handling. Finit no longer relies on mtime of .conf
files, instead an inotify handler tracks file changes for time insensitive dependency tracking[S]
with a condition <...>
failed to run. Finit now tracks run/tasks more carefully, waiting for them to finish before:161
, issue #87. Found by WestermoHOOK_SVC_RECONF
eventskill(0, SIGKILL)
initctl show
initctl
with STDOUT
redirectedinitctl start/stop <ID>
, using name worked not idinitctl start/stop
without any argument--debug
Published by troglobit about 7 years ago
Major release, support for conditions/dependencies between services, optional built-in watchdog daemon, optional built-in getty, optional built-in standard inetd services like echo server, rdate, etc.
Also, native support for Debian/BusyBox /etc/network/interfaces
, overhauled new configure based build system, logging to /dev/kmsg
before syslogd has started, massively improved support for Linux distributions.
Added basic code of conduct covenant to project
Added contribution guidelines document
Removed finit.conf
option check DEV
, replaced entirely by automated call to fsck
for each device listed in /etc/fstab
Removed deprecated and confusing startx
and user
settings. It is strongly recommended to instead use xdm/gdb/lightdm etc.
Add support for initctl log <SVC>
, shows last 10 lines from syslog
Add initctl cond dump
for debugging conditions
Ensure plugins always have a default name, file name
Reorganization, move all source files to a src/
sub-directory
Add support for initctl <list|enable|disable> <SVC>
, much needed by distributions. See doc/distro.md for details
Remove UNUSED()
macro, mentioned here because it may have been used by external plugin developers. Set -Wno-unused-parameter
instead
New table headings in initctl
, using top
style inverted text
Allow initctl show
to use full screen width for service descriptions
New HOOK_BANNER
for plugins to override the default banner()
Allow loading TTYs from /etc/finit.d
Improvements to built-in getty, ignore signals like SIGINT
, SIGHUP
, support Ctrl-U to erase to beginning of line
Add TTY nowait
and noclear
options
Allow using both built-in getty and external getty:
tty [12345] /dev/ttyAMA0 115200 noclear vt220
tty [12345] /sbin/getty -L 115200 /dev/ttyAMA0 vt100
tty [12345] /sbin/agetty -L ttyAMA0 115200 vt100 nowait
Silent boot is now the default, use --enable-progress
to get the old
Finit style process progress. I.e., --enable-silent
is no more
Support for configure --enable-emergency-shell
, debug-only mode
Support for a fallback shell on console if none of the configured TTYs can be started, configure --enable-fallback-shell
All debug messages to console when Finit --debug
is enabled
Prevent login, by touching /etc/nologin
, during runlevel changes
A more orderly shutdown. On reboot/halt/poweroff Finit now properly goes to runlevel 0/6 to first stop all processes.
Perform sync before remounting as read-only, at shutdown
Clean up /tmp
, /var/run
, and /var/lock
at boot on systems which have these directories on persistent storage
Call udev triggers at boot, on systems with udev
Add missing /var/lock/subsys
directory for dbus
Add support for poweroff
Add support for a built-in miniature watchdog daemon
Remove GLIBC:isms like __progname
Manage service states based on user defined conditions
Manage dependencies between services, w/ conditions (pidfile plugin)
Manage service dependencies on network events (netlink plugin)
Support for dynamically reloading Finit configuration at runtime
Refactor to use GNU configure and build system
New hooks for for detecting lost and started services (lost plugin)
External libraries, libuEv and libite, now build requirements
Early logging support to /dev/kmsg
instead of console
Support for redirecting stdout/stderr of services to syslog
Support for managing resource limits for Finit and its processes
Add optional built-in inetd services: echo server, chargen, etc.
Add simple built-in getty
Greatly improved accounting support, both UTMP and WTMP fixes+features
Improved udev support, on non-embedded systems
Improved shutdown and file-system unmount support (Debian)
Support SysV init /etc/rc.local
Inetd protection against UDP looping attacks
Support systems with /run
instead of /var/run
(bootmisc plugin)
Adopted BusyBox init signals for halt/reboot/poweroff
SysV init compat support for reboot (setenv)
Compat support for musl libc
Add OpenRC-like support for sysctl.d/*.conf
Add support for Debian/BusyBox /etc/network/interfaces
Add support for running fsck on file systems in /etc/fstab
Added example configs + HowTos for Debian and Alpine Linux
to support latest releases of both distributions
Lots of documentation updates
reconf
condition when initctl reload
has finished/etc/finit.d/*.conf
files when changing runlevel to halt or rebootinitctl
should display error and return error code for non-existing services should the operator try to start/stop them.net/*
conditions after initctl reload
fsck
on already mounted devices/var/log/wtmp
, created by Finitifup
exists before trying to bring up networking, also set $PATH
earlier to simplify run()
et al -- no longer any need to use absolute paths for system tools called from Finit. Thanks to crazyntohl()
in inetd handling, prevents matches. Thanks to Petrus Hellgren, Westermostdarg.h
in helpers.h
, thanks to Jörg KrausePublished by troglobit almost 8 years ago
Second pre-release,
--debug
is enabled/etc/nologin
, during runlevel changes/tmp
, /var/run
, and /var/lock
at boot on systems which/var/lock/subsys
directory for dbuspoweroff
__progname
Published by troglobit about 8 years ago
/dev/kmsg
instead of console--enable-emergency-shell
(configure) fallback debug mode/etc/rc.local
/run
instead of /var/run
(bootmisc plugin)/etc/network/interfaces
/etc/fstab
Published by troglobit almost 9 years ago
Bug fix release.
name:id
SIGHUP
caused a freeze due to Finit waiting forSIGHUP
services after reconfigurationPublished by troglobit almost 9 years ago
Bug fix release.
name:id
initctl show
, show actual statusinitctl reload
to change system configurationinitctl restart
: users expectSIGHUP
even if theNULL
pointer dereference causing kernel panic when user callsinitctl reload
after change of system configurationinitctl show
for services not inPublished by troglobit almost 9 years ago
Lots of fixes to handle static builds, but also fixes for dynamic event
handling and reconfiguration at runtime.
--debug
flag to initctl
initctl show
now hightlight theinitctl help
that the GW event toGW:UP
configure --disable-inetd
SIGHUP
'able, regression in v2.0HOOK_SVC_RECONF
only when all processes have been stoppedPublished by troglobit about 9 years ago
-Os
use -O2
as default optimization level. Many cross-Os
svc_t
forinitctl show
Published by troglobit about 9 years ago
Support for multiple instances and event based services, as well as the
introduction of an initctl
tool.
Note: Incompatible change to syntax for custom inetd
services, c.f. Finit v1.12.
The most notable change is the support for multiple instances. A must
have when running multiple DHCP clients, OpenVPN tunnels, or anything
that means using the same command only with different arguments. Now
simply add a :ID
after the service
keyword, where ID
is a unique
instance number for that service.
service #1 [2345] /sbin/httpd -f -h /http -p 80 -- Web server
service #2 [2345] /sbin/httpd -f -h /http -p 8080 -- Old web server
Another noteworthy new feature is support for starting/stopping
services on Netlink events:
service :1 [2345] <!IFUP:eth0,GW> /sbin/dropbear -R -F -p 22 -- SSH daemon
Here the first instance :1
of the SSH daemon is declared to run in
runlevels 2-5, but only if eth0 IFUP:eth0
is up and a gateway GW
is set. When the configuration changes, a new gateway is set, or if
somehow a new IFUP
event for eth0 is received, then dropbear is not
SIGHUP'ed, but instead stop-started <!>
. The latter trick applies
to all services, even those that do not define any events.
Support for reloading *.conf
files in /etc/finit.d/
on SIGHUP.
All task
, service
and run
statements can be used in these .conf
files. Use the telinit q
command, initctl reload
or simply send
SIGHUP
to PID 1 to reload them. Finit automatically does reload of
these *.conf
files when changing runlevel.
Support for a modern initctl
tool which can stop/start/reload and
list status of all system services. Also, the old client tool used
to change runlevel is now also available as a symlink: telinit
.
initctl [-v] <status|stop|start|reload|restart> [JOB]
Add concept of "jobs". This is a unique identifier, composed of a
service and instance number, SVC:ID
initctl <stop|start|reload|restart> JOB
Support for deny filters in inetd
services.
inetd service/proto[@iface,!iface,...] </path/to/cmd | internal[.service]>
Internal services on a custom port must use the internal.service
syntax so Finit can properly bind the inetd service to the correct
plugin. Here follows a few examples:
inetd time/udp wait [2345] internal -- UNIX rdate service
inetd time/tcp nowait [2345] internal -- UNIX rdate service
inetd 3737/tcp nowait [2345] internal.time -- UNIX rdate service
inetd telnet/tcp@*,!eth1,!eth0, nowait [2345] /sbin/telnetd -i -F -- Telnet service
inetd 2323/tcp@eth1,eth2,eth0 nowait [2345] /sbin/telnetd -i -F -- Telnet service
inetd 222/tcp@eth0 nowait [2345] /sbin/dropbear -i -R -F -- SSH service
inetd ssh/tcp@*,!eth0 nowait [2345] /sbin/dropbear -i -R -F -- SSH service
Access to telnet on port 2323
is only possible from interfaces
eth0
, eth1
and eth2
. The standard telnet port (23
) is
available from all other interfaces, but also eth2
. The *
notation used in the ssh stanza means any interface, however, here
eth0
is not allowed.
NOTE: This change breaks syntax compatibility with Finit v1.12.
Support for a more user-friendly configure script rather than editing
the top Makefile, or setting environment variables at build time.
Support for building Finit statically, no external libraries. This
unfortunately means that some plugins cannot be built, at all.
Big thanks goes to James Mills for all help testing this out!
Support for disabling the built-in inetd server with configure
.
Support for two new hook points: HOOK_SVC_RECONF
and
HOOK_RUNLEVEL_CHANGE
. See the source for the exact location.
The include <FILE>
option now needs an absolute path to FILE
.
patches/
to contrib/
to simplify integration in 3rd partyPublished by troglobit over 9 years ago
The inetd release.
finit.conf
finit.conf
, this makes it possible totime.so
inetd time/tcp internal
service to befinit.conf
.finit.conf
first inspect the console
setting and only if/bin/sh
console
TTY or /bin/sh
, finit now marksvfork()
instead of fork()
before exec()" from v1.11. Itdlopen()
resource leak by storing the pointer.Published by troglobit over 9 years ago
The libuEv release.
Note: This release has been yanked from distribution due to a regression in launching background processes and TTY's. Fixed in Finit v1.12.
make install
tty
is defined in finit.conf
, nowPublished by troglobit almost 10 years ago
Major bug fix release, courtesy of Coverity Scan.
run_interactive()
are veryhelpers.c:run()
helpers.c:run_interactive()
helpers.c:set_hostname()
helpers.c:procname_kill()
svc.c:svc_start()
: Fix swapped arguments to dup2() and addsvc.c:svc_start()
: Fix out of bounds write to local stackmknod()
, mkdir()
,remove()
, etc.