Troglobit

“Elegance is not a dispensable luxury” — Edsger Wybe Dijkstra

Fast, Extensible Init for Linux Systems

Fork me on GitHub

Finit is a small event based SysV init replacement with built-in process supervision similar to that of its more famous cousins daemontools and runit. Services are supervised and automatically restarted if they fail.

Finit targets small and embedded Linux systems by heavily reducing the amount of context switches, forks, and calls to external tools that most other init daemons suffer from.

Finit supports basic runlevels, process monitoring, and can launch services on demand – either with the built-in inetd support, or by triggering on Linux Netlink events like IFUP, IFDN or GW.

Finit can also be extended with custom callbacks for all services, hooks into the boot process, or plugins to extend the functionality and adapt the boot process to fit your needs. See the README for details.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# /etc/finit.conf - System bootstrap for TroglOS
user root
host default

# Default runlevel
runlevel 2

# Launch bootstrap services
service [S12345] /sbin/watchdogd -L -f                      -- System watchdog daemon
service [S12345] /sbin/syslogd -n -b 3 -D                   -- System log daemon
service [S12345] /sbin/klogd -n                             -- Kernel log daemon

# Services must not daemonize themselves, look for --foreground or
# similar switches to standard services.
#service [2345] /sbin/inetd -f                               -- Internet super daemon
service :1 [2345] <!IFUP:eth0,GW> /sbin/dropbear -R -F -p 22 -- SSH daemon
#service :2 [345] /sbin/dropbear -R -F -p 222                -- SSH daemon
#service [2345] /sbin/telnetd -F                             -- Telnet daemon

# Network bringup script
network /etc/init.d/networking

# System patch or extension scripts, see run-parts(8).
runparts /mnt/start.d

# Inetd services
inetd ftp/tcp                   nowait [2345] /sbin/uftpd -i -f       -- FTP daemon
inetd tftp/udp                    wait [2345] /sbin/uftpd -i -y       -- TFTP daemon
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 daemon
inetd 2323/tcp@eth1,eth2,eth0   nowait [2345] /sbin/telnetd -i -F     -- Telnet daemon
#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

# Allow login on ttyUSB0, for systems with no dedicated console port
tty [12345] /dev/ttyAMA0 115200 vt100
tty [12345] /dev/ttyUSB0 115200 vt100
console /dev/ttyAMA0

See TroglOS for an example of how to boot a small embedded system with Finit.


This project is the continuation of the original finit by Claudio Matsuoka, which was reverse engineered from syscalls of the groundbreaking EeePC fastinit daemon – “gaps filled with frog DNA …”

Issue tracker and GIT repository available at GitHub:

See also the Free(code) page.