Finit v2.0
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.
Changes
-
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:IDafter theservicekeyword, whereIDis 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 daemonHere the first instance
:1of the SSH daemon is declared to run in
runlevels 2-5, but only if eth0IFUP:eth0is up and a gatewayGW
is set. When the configuration changes, a new gateway is set, or if
somehow a newIFUPevent 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
*.conffiles in/etc/finit.d/on SIGHUP.
Alltask,serviceandrunstatements can be used in these .conf
files. Use thetelinit qcommand,initctl reloador simply send
SIGHUPto PID 1 to reload them. Finit automatically does reload of
these*.conffiles when changing runlevel. -
Support for a modern
initctltool 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:IDinitctl <stop|start|reload|restart> JOB -
Support for deny filters in
inetdservices.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 serviceAccess to telnet on port
2323is only possible from interfaces
eth0,eth1andeth2. The standard telnet port (23) is
available from all other interfaces, but alsoeth2. The*
notation used in the ssh stanza means any interface, however, here
eth0is 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_RECONFand
HOOK_RUNLEVEL_CHANGE. See the source for the exact location. -
The
include <FILE>option now needs an absolute path toFILE.
Fixes
- Rename
patches/tocontrib/to simplify integration in 3rd party
build systems. - Fix for unwanted zombies ... when receiving SIGCHLD we must reap all
children. We only receive one signal, but multiple processes may have
exited and need to be collected.