2021-05-17 15:41:14 +07:00
2021-04-09 15:08:00 +07:00
2021-04-18 23:04:26 +07:00
2021-05-16 20:59:27 +07:00
2021-05-07 20:33:09 +07:00
2021-05-07 19:37:55 +07:00
2021-05-16 21:16:08 +07:00
2021-04-07 23:48:33 +07:00
2021-04-07 23:47:17 +07:00
2021-05-17 15:41:11 +07:00
2021-05-17 15:40:53 +07:00
2021-10-21 21:14:46 +07:00

This is an experimental repo for finit on Artix.

UPDATE: See Conclusion

========================================================================

What's (not) working:
1. LVM/cryptsetup support
   The main problem is the boot up seem to run in parallel, processes
   don't wait for tasks to be finish before moving to the next stage
   (eventhough I used the <hook/mount/root> which (I think) is the first
   thing in line, before everything in /etc/fstab will be mounted).
   Also, the boot up process don't accept input, which would be a
   problem for a passphrase-only encrypted systems. The creator
   recommended to either:
   - Use initramfs even for non-root partitions
   - Use the native plugin system (unfortunately, I'm not well-versed in
     C)
   https://github.com/troglobit/finit/issues/74

   UPDATE: I discovered that apparently it is possible to run cryptsetup
           script with runparts, however, this can mean that we need to
           do the mounting twice, once by finit, and once by Artix since
           we unlocked the LVM and cryptsetup scripts in runparts. It's
           a dirty way, but it's rather simple comparing to creating a C
           program.

========================================================================


Directory and Configuration Structure
=====================================

finit's main configuration resides in /etc/finit.conf, while service
files are located in /etc/finit.d/available, for all installed services,
and /etc/finit.d/enabled, for all *enabled* services.

Due to a lot of services that may have some prior commands that must be
run, those services will need a wrapper script. We will place it in
/etc/finit.d/scripts for services, /etc/finit.d/rc.init for boot up, and
/etc/finit.d/rc.shutdown for shutdown respectively.


General syntax
==============

finit's general syntax configuration for standalone services look like
this:

  service [2345] <pid/dependencies> serviceexec -- Service Description


Service wrappers
================

If a service requires additional commands before starting the service
proper, it is generally recommended to put the service in a wrapper
script first, we'll place it in /etc/finit.d/scripts as described above.

Suppose a service (let's say chrony) needs some file to exists before it
started, we simply add a file to /etc/finit.d/scripts with the name
chronyd:

  #!/bin/sh
  install -d -m750 -o chrony -g chrony /var/run/chrony
  exec chronyd -n -u chrony

Then we invoke the wrapper script to the proper service file in
/etc/finit.d/available:

  service [2345] /etc/finit.d/scripts/chronyd


Oneshots
========

Fortunately, finit supports oneshots. There are two possible operations
for oneshots:
- task, for services to be run in parallel in a runlevel
- run, for services to be run in sequence in a runlevel

Snytax should be similar to the usual service operation.


Background
==========

While finit prefers a foreground-only process, there will be a process
which cannot be run in foreground. While finit does support it, we'll
need to specify the PID file, so the syntax would be something like
this:

  service [2345] pid:!/path/to/process.pid /usr/bin/process


Conclusion (but still under construction)
=========================================

Well, it's been a fun adventure. I like finit. I really do. But I
think there are some pretty killer disadvantages. I'll try to address
it (along with the advantage of course).

1. Advantages of finit

  - Simple service syntax
    This is one of my absolute favourites feature of finit. It's general
    service syntax is pretty much easy to write. Though I would prefer a
    daemontools/runit/s6 per-file configuration, I have a very pleasant
    experience with finit.

  - Integrated CGroups v2 support

  - Quite fast boot times

2. Disadvantage(s)

  - Inflexibility of Stage 1 (bootup) and Stage 3 (shutdown)
    One of the pain points I experienced for sure, one of the killer
    disadvantages that too bad, made finit not suitable for us. Since
    some of Artix users inevitably use LVM and LUKS, a nested FS
    support would be great, but it's not in finit creator's use case, so
    that's understandable. We can of course add the support ourselves,
    but the barrier is quite high (creating finit modules will probably
    use C instead of shell, and personally, I'm quite s**t at C), so we
    can't just add our own modules, unless someone wants to contribute.

Overall, it's a fun experience and experiment. If you like to try finit,
I absolutely recommend it. But unfortunately, I won't be officially
supporting it for Artix.
Description
No description provided
Readme 70 KiB
Languages
Shell 100%