finit
Configure
Section titled “Configure”- Check if explicitly setting
--with-headingand--with-hostnamehardcodes the values intofinitpreventing it from parsing/etc/os-releaseand/etc/hostnameat run time or if it only affects the default values replacing the previouss6servicehostname - Check if we should enable the
netlinkplugin - Check if we should enable
resolvconfplugin as it is intended for debian’s legacyresolvconfimplementation andopenresolvis “fully command line compatible” with debian’sresolvconf(seeplugins/resolvconf.c)
Package
Section titled “Package”- Check if we should provide a minimal
/etc/finit.conf
- Check if
finitfalls back to/bin/shif no ttys are configured in/etc/finit.conf - Check if the fallback shell is good enough to be used in an initramfs and in rescue environments
- Check if we can fully replace
mdevd’s functionality:- in the
initramfsas acoldplugwithmdevd -C:- a summary of what
mdevd-coldplugandudevadm triggerdo:
Terminal window for i in $(find /sys -name uevent); do ( echo change > $i ) ; done- a summary of what
finit’smodprobeplugin does (which we currently disable with--disable-all-plugins) withoutkeventdor any device manager:
Terminal window find /sys/devices -name modalias -print0 | xargs -0 sort -u -z | xargs -0 modprobe -abq- a
coldplugscript can also be found under/usr/lib/finit/coldplugwhich is meant to run withmdev -df(and maybekeventd?):
Terminal window find /sys/devices -name uevent -print | while IFS='' read X; do echo add > $X; donefinit’s/usr/lib/finit/keventdcan be run withkeventd -cwhich also does coldplug at startup (seekeventd/uevent.c)
- a summary of what
- in the services after
initramfshands control tofinitreplacing the previouscoldplugandmdevdservices- the
coldplugservice can be replaced withkeventd -c(or themodprobeplugin?) (is a secondcoldplugreally needed here? I think it is a good idea to keep it since we can’t guarantee whether theinitramfsimplementation preserves/devafter aswitch_root(even with amount -Mbefore switching) or if aninitramfsexists in the first place) - the
mdevdservice can be replaced withkeventdas it defaults tonetlinkgroup4(for compatibility withlibudev’s0x4) replacingmdevd -O 4(also do not supply readiness-D 3tomdevdas it only works withs6) finitstartskeventdas an internal service and controls it via symlinks in/run/finit/cond/(seedoc/keventd.md)keventdcan be run independently withcoldplugto populate/devfrom scratch usingkeventd -c -n(seedoc/keventd.md)
- the
- in the
- Check if we need services for network interfaces like
lo(should depend oncoldplug) with bothup(ip link set lo up) anddown(ip link set lo down) scripts - Both
finitands6do not handleefivarsautomatically and anfstabentry or ataskmay be required (we should also check if this mount should happen early on theinitramfsand if the boot loaderlimineshould be responsible for it?):
efivarfs /sys/firmware/efi/efivars efivarfs defaults 0 0Prepare
Section titled “Prepare”- Optional dependency on
libcapthat is enabled by default as it allows services to run with minimal required privileges instead ofroot(seedoc/config/capabilities.mdandsrc/service.c) keventddepends onutil-linux’slibblkid.so.1and it is enabled by default
Configure
Section titled “Configure”- It is recommended to enable
auto-reload(unlikes6which requires a database compilation with every change) kernel-cmdline,fastbootandfsckfixare disabled by default- It is not recommended to enable
kernel-cmdline(pre-4.1 behavior) andfsckfix - Explicitly use
--enable-fastbootto skipfsck(similar tos6-linux-initwhich ignores-fand-Ffor compatibility) - Explicitly use
--disable-pamaspamsupport is enabled by default finitsupportscgroupversion2only and it is enabled by default at build-time and at run time it autodetects if the kernel supportscgroupby checking/sys/fs/cgroupor if an initramfs has already mountedcgroup2there replacing the previouss6servicecgroups- Explicitly use
--disable-logrotateas we no longer provideutmpandwtmpsupport - Explicitly use
--disable-all-pluginsthen enable only those that are needed finitalways enables thebootmisc,pidfile,procps,sysandusrplugins even with--disable-all-pluginsdbusplugin is implicitly set toautoeven with--disable-dbus, whereas--disable-all-pluginsensures it is disabledttyplugin is enabled by default and--disable-all-pluginsensures it is disabled as we have no use for newttynodes watcher- Do not change default
fstabas it is automatically set to$sysconfdir/fstabwhich correctly resolves to/etc/fstab - Explicitly specify
--with-heading="$PRETTY_NAME"as we already export it and the default/etc/os-releasemay not exist where and whenfinitmay be built random-seedis enabled by default and defaults to/var/lib/misc/random-seedand with--enable-urandom-pluginreplacing the previouss6servicerandom-seedrtcplugin is enabled by default and it fully replaces the previouss6servicehwclockwithout relying on thehwclockbinary fromutil-linuxlibsystemdis a shim forsd_notify()only and is disabled by default (pipewire and some wayland compositors may require it)- Both
rtc-dateandrtc-fileare disabled by default, even whenrtcplugin is enabled, this means thatrtc-datewill use the default value of2000-01-01 00:00which is reasonable enough, and that nortc-filewill be used as we plan to only runfiniton systems with a physical hardware clock/dev/rtc(perhaps for future use inside containers--with-rtc-filecan be used and it will default to/var/lib/misc/rtcbut then why usefinitat all inside a container?) - The
resolvconfplugin does not replaceopenresolvas it lacks any resolving logic and is only responsible for creating directories like/etc/resolvconf - Do not change the default runlevel
2asfinittreats runlevels[234]identically as multi-user mode and reserves1for single-user mode without networking - Disable the built-in
watchdogdaemon as it is enabled by default on/dev/watchdogand glaucus does not use it finitalso supports integration withwatchdogd(an externalwatchdogdaemon also fromtroglobit)- Leave
groupset to its default valuerootas it controls ownership of/run/finit/socketwhichinitctluses and/run/finit/buswhichdbususes though we disabledbus(another logical value iswheel) - Leave
sysconfigset to its default values/etc/defaultand/etc/conf.das both of them are expected (seedoc/example.mdandsrc/sample.conf) - The default path for “bundled” plugins is
/usr/lib/finit/pluginsand the default path for “external” plugins is/usr/lib/finit/plugins:/usr/local/lib/finit/pluginsso we explicitly set--with-plugin-path=/usr/lib/finit/pluginsto remove/usr/localfrom the “external” plugin path - Explicitly pass
--without-suloginto disable the built-insuloginas we already pass--disable-rescueand we have no use ofsulogin(even fromutil-linuxandtoybox) as it is generally a better idea to use another live medium to rescue a broken one --without-rc-localdisables/etc/rc.localsupport as/etc/rc.localblocksfinitandinitctlat boot after runlevelS(or at least used to) and is mainly provided for compatibility with existingsysvinit systems- Do not enable the
hotplugplugin as it startskeventdin passive mode-pleaving device management toudevd,mdevdormdevfromsystem/10-hotplug.confandkeventdonly monitors power supply events (seedoc/keventd.md) - A curated ruleset from
eudevversion3.2.14is installed by default whenkeventdis enabled and--without-udev-rulesskips the installation (seedoc/keventd.md) keventdhas a small built-in permission table that is functionally equivalent tomdev.conf- Keep the
modprobeplugin disabled by default askeventdalso probes modules in addition to creating device nodes - Do not use
--disable-redirectas it dumps output to the active console breakingloginprompts instead of/dev/null(the default) - Upstream advises against using
--disable-kernel-loggingas it silences too much and runs too late to hide early boot messages and thatquietshould be used instead incmdline - Both
plymouthandtestservplugins are disabled by default (still we already pass--disable-all-pluginsregardless) - Keep the
hook-scriptsplugin disabled by default as it is used for early boot debugging and kernel tracing, also it does not hurt to explicitly pass--without-hook-scripts-path(seedoc/plugins.md)
finitversion4is not compatible with version3finitversion5provides its own device managerkeventdfinitprobes all installed device managers (so never havemdevdinstalled alongsidekeventd)finithandles/dev,/procand/sysautomatically (seesrc/finit.c)finithandles/dev/ptsautomatically with the correct options and permissions (seesrc/finit.c) replacing the previouss6servicedevptsfinithandles/dev/shmautomatically with the correct permissions1777and additionally mounts atmpfsover/dev/shmwhich is something we may not need (for software likedbusto work which glaucus does not use) (seesrc/finit.c)finithandles/proc/self/fd,/dev/fd,/dev/stdin,/dev/stdoutand/dev/stderrautomatically with the correct symlinks (seeplugins/bootmisc.cwhich runs after all filesystems have been mounted)finitcreatesinitandtelinitin/usr/binautomatically as correct symlinks tofinitreplacing the previouss6scripts under/usr/bin(seeINIT_LNKSinsrc/Makefile.in)finitcreateshalt,poweroff,reboot,shutdownandsuspendautomatically as correct symlinks toinitctlreplacing the previouss6scripts under/usr/bin(seeREBOOT_LNKSinsrc/Makefile.in)mdevddepends on/dev/ptsand/dev/shmand/proc/self/fdfinithandles/run/lockautomatically with the correct permissions1777and additionally mounts a smalltmpfsto protect against user DoS of/run(seesrc/finit.c)finithandles/tmpautomatically with the correct permissions (seesrc/finit.c)finithandles bothswaponat boot andswapoffat shutdown replacing the previouss6serviceswap(seesrc/finit.c,src/mount.candsrc/sig.c)finitadopts almost identical signals tos6includingSIGINT,SIGPWR,SIGTERM,SIGUSR1,SIGUSR2andSIGWINCHwith the exception ofSIGQUIT(onlys6) andSIGHUP(onlyfinit,s6does not provide it under.s6-svscan/) (seesrc/sig.c)finitprovides a lightweight built-intmpfiles.dsupport allowing relatively easier modifications of directories and permissions removing the need for patching (anfinittask can also be created to do the same job)finitprovides a built-ingetty(seesrc/getty.c) and it is used whentty tty2 { device = "/dev/tty2" }whereastty tty2 { command = "agetty -8 -L tty2 115200" }runs an externalgettyfinitdoes not default to38400baud rate and instead defaults to the kernel default baud rate also prefer higher baudrates like115200for faster data transfer (usebaud = 115200in config)- The
ttyplugin handles dynamic hotplug events for serial/usbttydevices like/dev/ttyUSB0and it does not manage static virtual consoles liketty1totty6which are controlled by the kernel’sttysubsystem and if agetty(whether built-in tofinitor external) was waiting for input there then we see a login prompt, otherwise a blank screen is shown finithandles remounting/as read-write automatically replacing the previouss6servicerw(seesrc/finit.c)finithandlesfstabautomatically replacing the previouss6servicefstab(seesrc/finit.c)- Check if further logging (
/var/log/{dmesg,messages,syslog}) is required - Disable unnecessary
systemd-like functionality like/etc/sysctl.dand maybe/etc/modules-load.d(we may enable themodules-loadplugin if necessary) - Do not forget to check for wrong permissions
1000:1000oniso /dev/fdexists on other unices and is provided underlinuxfor compatibility whereas/proc/*/fdis specific tolinuxsysctl()the syscall is officially deprecated, but the binarysysctlis what is recommended nowadays and uses/proc/sys.ICE-unixand.X11-unixin/tmpbelong toxorgand have been removed- Pseudo-filesystems (like
cgroupsandtmpfs) may fail to unmount at the end of shutdown (this usually does not result in data loss) - Runlevel
1is the single-user mode without networking - Specifying
singleandSin the kernel cmdline startsfinitwith runlevel1 - We keep an explicit
modprobe loopin theinitramfsof glaucus live iso as a safety measure given that theloopdevice is virtual and itsuevententry may not produce amodalias
References
Section titled “References”- https://finit-project.github.io/
- https://gitea.artixlinux.org/konimex/finit
- https://github.com/Andrey0189/sinit-scripts
- https://github.com/InitWare/InitWare/wiki/Dropped-components
- https://github.com/chimera-linux/dinit-chimera
- https://github.com/eweOS/dinit-services
- https://github.com/finit-project/finit/blob/master/doc/ChangeLog.md
- https://github.com/finit-project/finit/blob/master/doc/build.md
- https://github.com/finit-project/finit/blob/master/doc/cmdline.md
- https://github.com/finit-project/finit/blob/master/doc/config/capabilities.md
- https://github.com/finit-project/finit/blob/master/doc/config/files.md
- https://github.com/finit-project/finit/blob/master/doc/config/logging.md
- https://github.com/finit-project/finit/blob/master/doc/config/pam.md
- https://github.com/finit-project/finit/blob/master/doc/config/runlevels.md
- https://github.com/finit-project/finit/blob/master/doc/config/sysv.md
- https://github.com/finit-project/finit/blob/master/doc/config/tty.md
- https://github.com/finit-project/finit/blob/master/doc/dbus.md
- https://github.com/finit-project/finit/blob/master/doc/distro.md
- https://github.com/finit-project/finit/blob/master/doc/features.md
- https://github.com/finit-project/finit/blob/master/doc/plugins.md
- https://github.com/finit-project/finit/blob/master/doc/runlevels.md
- https://github.com/finit-project/finit/blob/master/doc/runparts.md
- https://github.com/finit-project/finit/tree/master/contrib/alpine
- https://github.com/finix-community/finix
- https://github.com/fszontagh/gl-recipes/blob/master/finit.sh
- https://github.com/glaucuslinux/glaucus/releases/tag/30092020
- https://github.com/kernelkit/infix
- https://github.com/medvid/make-rootfs/blob/master/pkg/files/finit/finit.conf
- https://github.com/troglobit/myLinux
- https://github.com/xhebox/noname-linux/blob/master/archived/finit/finit.conf
- https://gitlab.alpinelinux.org/PureTryOut/dinit-alpine
- https://leahneukirchen.org/blog/archive/2025/08/comparing-nitro-to-runit.html
- https://oscomp.hu/without-systemd/Alternatives_to_systemd.html
- https://troglobit.com/projects/finit/