Skip to main content
Topic: Comparison of the init systems (Read 9464 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Comparison of the init systems

Hello everyone.

After using Arch for 4 years now, I am becoming tired of dealing with systemd, as stuff keeps breaking and the performance is very poor. I want to switch to Artix, but am wondering which init system to choose. I mainly hope to increase my system performance with this step (startup time, ram usage).

So far, I've found this "comparison": https://gist.github.com/themagicalmammal/37276c97897d40598e975f5e563252a6#1-selecting-the-correct-init
According to it, I should pick S6. I've also read that S6 is by far the most complicated init system, however I feel confident in learning it, as I already have a fairly solid knowledge of linux already.
However, the article doesn't mention dinit at all. How's your experience with Dinit (especially considering performance)?

The dinit repo also has a comparison of different init systems: https://github.com/davmac314/dinit/blob/master/doc/COMPARISON

The gentoo wiki also has a comparison: https://wiki.gentoo.org/wiki/Comparison_of_init_systems
What does "Per-service configuration" mean?

Here's a write-up of what I've gathered so far
Runit
oldest one, it just works out of the box, but doesn't get any new features. Does not have dependency management. Runit uses a three-step init scheme.

OpenRC
pretty active project, they have 130 contributors on github. But how is it different to the others?
OpenRC is partly written in Shell scripts? So it might be slower?

S6
a minimal attempt at an init system, it gets somewhat regularly updated. Configuration uses one directory for each service with each parameter being specified in its' own file. Why? It looks like, s6 and the services can't be modified at all at runtime. Do I have to restart my pc everytime a service definition changes? What is the difference between s6 and s6-rc?

66
"A collection of tools built around s6 and s6-rc". As the 66 package depends on s6, I guess it is the S6 init program, and there are some tools available to the user for service creation? So installing 66 over s6 shouldn't impact the performance of the system at all? Also, 66 is developed for and by Obarun?

Dinit
Made it just two months ago into Artix. Seems to me to feature a more sane service configuration than s6.


In systemd, I can create system units and user units, I've used this on my pc for things like the system bar, tray applets, compositor, etc. Does any init system have support for this out of the box? Or do I have to run another instance of the init system as the user logs in?

Which init system do you use and why?
I want to create a wiki page from my gatherings, how can I register for a wiki account?
On a spare hard drive, I installed multiple versions of Artix with each init system and want to test the different init system's performances, I'd also add my findings in that matter to the page.

Re: Comparison of the init systems

Reply #1
Quote from: scrouthtv
Or do I have to run another instance of the init system as the user logs in?
Umm, what? That almost sounds like you're trolling, especially combined with
Quote from: scrouthtv
as I already have a fairly solid knowledge of linux already.
One init, PID1.

To answer the first question, I use OpenRC, mainly because I hopped onto the Artix wagon early on, when OpenRC was, if I don't remember wrong, the default and maybe even the only option. It works. I have a pretty standard (although minimalistic) desktop setup, and after the first install, I haven't needed to change anything. I don't see any purpose in trying out anything different. I often wonder about all this talk about "how easy is [some init] to learn?", "does [some init] support [feature]?". I just have never in my life encountered any of these problems that all these various novel init systems seem to be trying to solve... KISS?

I also don't understand all the talk about speed. I even turn my computer off for the night, so I actually deal with the several second long boot sequence every single day. Imagine the time wasted! I mean seriously, my machine boots up in the time I adjust my seat. If it were any faster, it would just idle there before I got around to log in. Besides, it seems pretty much everyone who mentions their hardware on the forums runs significantly more powerful machines than my old quad-core.

There is also https://core.suckless.org/sinit/
Quote from: suckless.org
sinit is considered complete and no further development is expected to happen.
I wish that could be said about more programs.

Re: Comparison of the init systems

Reply #2

In systemd, I can create system units and user units, I've used this on my pc for things like the system bar, tray applets, compositor, etc. Does any init system have support for this out of the box? Or do I have to run another instance of the init system as the user logs in?

s6/s6-rc, 66, and dinit can all run user services. It takes some extra setup to do so though.

Re: Comparison of the init systems

Reply #3
In systemd, I can create system units and user units, I've used this on my pc for things like the system bar, tray applets, compositor, etc. Does any init system have support for this out of the box? Or do I have to run another instance of the init system as the user logs in?
How to set up user services in s6: https://forum.artixlinux.org/index.php/topic,3067.0.html
In runit: https://docs.voidlinux.org/config/services/user-services.html


Re: Comparison of the init systems

Reply #5
Quote
Umm, what? That almost sounds like you're trolling, especially combined with

No, I'm for real. Yes there is the PID 1 system-wide init system, but I was wondering whether I can run another init system with using another configuration after the user logs in, to manager user processes that don't need to be elevated, e.g. https://forum.artixlinux.org/index.php/topic,3268.0.html

Quote
I also don't understand all the talk about speed.
Hm, okay. My current setup is Arch on a T410 with an ssd, and it takes half a minute to reach graphical. I guess that can't be improved much with a different init system?

Why is s6 using a compiled database if we don't care about the boot time that much after all? Did Laurent care about the boot time that much?

Now you're trolling /s

Quote
s6/s6-rc, 66, and dinit can all run user services
Thanks for confirming.

Quote
more research
I was mainly wondering whether there are differences in the core philosophies of each init system. The wiki page for each init system says something along the lines of
  • service supervision framework-
  • system initialization

OpenRC - runlevels
Runit - basic runlevel support
S6 - bundles (basically the same as runlevels?), live database is compiled
66 - s6 with easier readable commands?
dinit - no targets / runlevels, services are just globally enabled? commands are pretty close to systemd

The commands for each init system look different, but in the end, they do the same.

http://troubleshooters.com/linux/init/features_and_benefits.htm

Re: Comparison of the init systems

Reply #6
Perhaps looking at hibernate / suspend options would improve your startup times, if that was a priority? Different hardware and requirements leads to different choices. I think ultimately you need to try some of them and see what works for you.

Re: Comparison of the init systems

Reply #7
The gentoo wiki also has a comparison: https://wiki.gentoo.org/wiki/Comparison_of_init_systems
What does "Per-service configuration" mean?

From what I've gathered, this means native support for service templates, such as systemd's [email protected] files or OpenRC's /etc/init.d/service.extension files.

Quote
S6
Configuration uses one directory for each service with each parameter being specified in its' own file. Why?

S6's entire design was greatly influenced by daemontools, and one of its principles was reusing as much of the underlying OS functionality as possible. One consequence is using the filesystem as a way to store data, since, well, that's what it is.

Quote
What is the difference between s6 and s6-rc?

s6 is a process supervisor, which means it monitors long lived processes (daemons), ensures there's only one instance of them at a time and restarts them if they crash. s6-svscan, s6-supervise and s6-svc are part of s6.

s6-rc is service manager: it orders initialization (since s6 alone doesn't do dependency management) and takes care of one time tasks. s6-rc-compile, s6-rc-update, and the s6-rc command itself are part of s6-rc. It happens to be made by the same author (skarnet) and to defer management of daemons to s6 due to the benefits mentioned above.

One way to make the distinction clearer is by looking at other software that fit these bills: runit is also a process supervisor, and OpenRC is also a service manager. What's different is the integration: runit doesn't have an accompanying service manager (so no dependency management, and one-time tasks are handled by a completely separate stage script), and OpenRC has to use alternative means (such as PID files) to have the guarantees provided by process supervisors.

To best understand s6, I'd recommend watching skarnet's 15 minute tour of the s6 design at FOSDEM. There is also a "director's cut" of the presentation that goes into more specific details (including why use one-setting-per-file instead of bigger configuration files).

Quote
Do I have to restart my pc everytime a service definition changes?

Of course not. You just compile a new database and then tell s6-rc to load it (using s6-rc-update) on top of the existing one.

On an Artix s6 system, the entire song and dance is performed for you by a pacman hook (s6-rc-db-update-hook), so it Just Werks™.

Quote
Why is s6 using a compiled database if we don't care about the boot time that much after all? Did Laurent care about the boot time that much?

The compilation step ensures that the system doesn't become unbootable due to broken dependencies and gives an easy way to roll back the entire set of services if something goes wrong.

Quote
In systemd, I can create system units and user units, I've used this on my pc for things like the system bar, tray applets, compositor, etc. Does any init system have support for this out of the box? Or do I have to run another instance of the init system as the user logs in?

With the exception of 66, Artix's init systems' developers usually consider these something the distribution or user should take care of rather than a necessary feature that should be provided upstream. So yes, you'd need to run another instance of the init system on login yourself.

66 is the only init scheme in Artix natively supporting user services, if that's what you're looking for, but it seems to be the least used.

Quote
Which init system do you use and why?

s6. Learning to use it taught me a lot about Unix and Linux in general. It seems to be designed to be as thin of a layer as possible over the OS, and I used quite a lot of s6 pieces in runit before diving in fully. Skarnet.org (the homepage) goes into detail about many "why"s of it, and even if you disagree, you can't say you don't get where he's coming from.