LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Anyone tried finit aka fast init on Slackware? (https://www.linuxquestions.org/questions/slackware-14/anyone-tried-finit-aka-fast-init-on-slackware-4175713703/)

Didier Spaier 06-21-2022 02:39 PM

Anyone tried finit aka fast init on Slackware?
 
links:
https://troglobit.com/projects/finit/
https://github.com/troglobit/finit

Primary target is embedded systems, however there are tutorials for Void, Alpine Linux, Debian GNU/Linux and derivatives (official package for SID).

Caveat: I am not interested by the usual boring discussions/flame wars wrt various init systems. Please answer only if/when you have actually tried finit on Slackware or another OS, possibly in an initramfs or embedded system.

h2-1 06-21-2022 08:01 PM

I'm interested in this, inxi tries to support all init systems, but finit is new to me.

Any idea how it can be detected, does it run on /proc/1/comm ?

I'd like to get that supported as soon as possible, I'd never heard of this one.

Also, does it have a -v/--version type option

Does it use initctl, or is that just optional? Or does it use its own init tool, like systemctl, rcctl, service, etc?

I'll add tentative support for that until it's confirmed more with data. Maybe I'll try a void test.

I also don't have any data on initctl, in terms of what its output looks like for: initctl status [service]

walecha 06-23-2022 02:15 AM

Quote:

Originally Posted by h2-1
Any idea how it can be detected, does it run on /proc/1/comm ?

yes, it came with it's own init (/sbin/finit and /sbin/initctl).

Quote:

Also, does it have a -v/--version type option
what do you mean by version option?

Quote:

I also don't have any data on initctl, in terms of what its output looks like for: initctl status [service]
here you go
Code:

root@app4099:~# initctl status php-fpm
    Status : running
  Identity : php-fpm
Description : PHP-FPM
    Origin : /etc/finit.d/php-fpm.conf
Environment :
Condition(s): <+net/lo/up>
    Command : php-fpm -F
  PID file : /run/php-fpm.pid
        PID : 605
      User : root
      Group : root
    Uptime : 2 hour 56 min 20 sec
  Restarts : 0 (0/10)
  Runlevels : [--2345----]
    Memory : 45.8M
    CGroup : /system/php-fpm cpu 0-5 [100, max] mem [0, max]
              └─ 605 php-fpm

Jun 23 09:48:54 app4099 finit[1]: Service php-fpm[0] died, restarting (1/10)
Jun 23 09:53:10 app4099 finit[1]: Service php-fpm[0] died, restarting (2/10)
Jun 23 10:05:28 app4099 finit[1]: Service php-fpm[0] died, restarting (1/10)
Jun 23 11:14:35 app4099 finit[1]: Service php-fpm[0] died, restarting (1/10)

This is on vm using slackware64-15.0

h2-1 06-23-2022 12:16 PM

Great, clean syntax. What is the result if you give it a non-existent service, like so:

Code:

initctl status foo-bar
and also for a service that is present but not running, ie, stopped? inxi cares about three init states, running, stopped, and failed/not found.

-v/--version is standard optional to get version info, in this case from finit, but reading its man page it doesn't list support any options at all, so I assume it doesn't have it. It's always nice to be able to get init version, can even get it sometimes from sysvinit using strings on some systems, though that's a special case.

I can't believe I missed initctl since apparently that was also used by Upstart, but I only really ran upstart in vm ubuntu, didn't spend much time on it, figuring, correctly, that it would go away as many Ubuntu projects tend to do.. Mir... Unity... etc...

walecha 06-25-2022 11:07 PM

finit version can be obtained using -v option
Code:

$ /sbin/finit -v
Finit 4.3
Bug report address: https://github.com/troglobit/finit/issues
Project homepage: https://troglobit.com/projects/finit/

As far as my experiment shown, finit can track service/task state: running, stopped, crashed/restart/failed (missing the wanted output or dependency of the service), ready (waiting for condition to be ready to start), and missing service configuration (renamed/removed). Any services is a symlink to the /etc/finit.d/available/*.conf that will be retouched using `initctl reload` to update the list of enabled services and then reloading/restarting any updated running services.

h2-1 06-25-2022 11:44 PM

The finit man page didn't list any option support, thanks for checking empirically. This should be working with pinxi now, always nice to add support for something new for next inxi, I try to do that in general, but it's hard to predict what will pop up.

For the initctl stuff I have to see the output for the 2 commands, non-existent/failed, and stopped/paused, depends on their syntax, inxi has to know what to look for, it maps all string values to consistent set of 3 values which are the same for all init systems, which are I believe: running, stopped, failed. I don't try to get more granular than that because that part is only used in I think Bluetooth, and for display manager if > 1 I think, tries to see which is running/stopped. Maybe 4 values, I forget, since systemd has stopped and disabled, which are different things. I think some other init tools have stopped/disabled, but most usually have disable remove the command if I remember right.

Bit by bit though, nice to add one, looks like Void is using it, maybe Alpine and Artix may, so it will exist out there in Linux-land.


All times are GMT -5. The time now is 03:39 PM.