S6 mega thread

Thing is, that’s actually pretty good design if you account for all the pros and cons. The reality is most services can tolerate some delay in startup of their dependencies, some even count them in. And if they don’t, that’s what After= is for.
You keep using examples that would benefit from using After= and that’s fine - use After= then. But what if you have nginx service and uwsgi. nginx Requires=uwsgi, but instead of failing if uwsgi is not running, it’s displaying a default page akin to service is currently down or starting up. This way you can get reasonable feedback from your server and sense the status without logging into backend.
Another non-standard example would be to have two services that require each other to work, i.e. they work in tandem. Say my-web-frontend.service and my-web-backend.service. Again, you will probably have some sane fallbacks/warning within the services.
What’s even more crazy, you can specify Requires= and Before= instead of after.
Say you have a backend.service that [email protected] [email protected] [email protected], but needs them started after the main service, so specifies [email protected].
In this case I’m pretty sure (although I didn’t test it) that you can add any number of [email protected] units by the means of systemctl enable, but still require at least N within the main service file.

Again, not the case if you write your unit files correctly. I’m pretty sure you can hurt yourself as well in all the other init/supervisor systems if you do dumb things :wink:

That was to illustrate why you’d use WantedBy=mutli-user.target instead of RequiredBy=multi-user.target. I’m pretty sure failing to reach multi-user.target because of a flaky network connection is a bad idea :wink:

You mean like journalctl? xD
Systemd can be pretty verbose with failing services so it’s quite easy to find out which parts are failing and when.

I never thought of it and it sounds just as insane. In s6, if you have my-web-frontend and my-web-backend that need each other to work, but they can actually start up and run without the other, then you don’t have any dependency, you just start them in parallel. If one or the other dies and they can handle such situations, then just give it a couple seconds (to however much it takes if it’s a really heavy daemon) to get started back up by the service supervisor and they’ll be back “in sync.”

And if you have my-backend-worker-{1,2,3}, that need to be started after my-web-backend, then that’s just a simple dependency inside worker-{1,2,3} on my-web-backend.

To start all of them at once, just make a bundle “my-web” and include all of them. Need to add more workers? Make their service files and add them to “my-web” bundle and they’ll all be started up.

If your program really, really, really requires that all the programs get started in specific orders and must pause until everything is started (first off, fix your software! and second,) then don’t do the startup in the service manager. Only do one “master” service that starts your own service manager, which then starts your services. I’ve seen tons of enterprise software that do this (and IM-not-so-HO it’s very poor design).

This circles back to what I was saying about runit services, giving service writers more work (sure, it’s pretty small in both cases, a very small line, but it’s there and requires attention to prevent race conditions).

I got the message from the first time. I was saying that you don’t need to overcomplicate the design for that with weak dependencies (and depending on the threat model, someone will want their VPN to be RequiredBy=multi-user.target and Before=multi-user.target). In s6, simply move the VPN to the “multi-user.target” bundle and add it as a dependency to any services in the same bundle that require it.

I think journalctl is a nice addition to systemd (just that I abhor that it’s in binary format - I really can’t remember if I tried to run journalctl on a broken system in a chroot, only to be met by the error message that systemd isn’t running as PID 1, or if I haven’t tried that). I think socklog should be a default in any runit system and I love that s6 comes with s6-log.

But I meant more like something that looks inside the logs and sends you alerts (unless journalctl can do that and I’m not aware of - in which case, omg why?), or a monitoring software (zabbix, prometheus etc.).

Same with the default verbosity in s6 (although it can be more verbose). Whenever any systemd-based OS booted up and had a failing service, I pretty much always knew which one (and could reboot and chroot in to fix it).

Courtesy of jaskij

This article articulates what set me down the path of total minimalism even in peril of breakage… And why jaskij doesnt like init systems. Unironically they are the same reason

DEVELOPERS keep pushing complexity over simplicity and modularity. That modularity can make it extensible and easy to integrate in a large program and I couldnt agree more. @jaskij and I were talking else where

Go back to the unix philosophy

Make a program simple
Make it really good at one task
Make it modular and extensible

Only after that should you make it simple to update/modify but if you did the above… You should have no issue achieving this

This seems like off topic but it isnt. Very much do developers of init systems, daemons, service supervisors, userspace tools. All of them need to draw inspiration from what made the 'nixs powerful

That kinda ties into s6. It’s a very minimal, unix-style init, process supervision and service manager suite, i.e. single programs that tie to each other, but that you don’t have to use together (as discussed earlier, because of s6’es modularity, 66-suite became its own service manager, replacing s6-rc in systems where people don’t want to use that, but still making use of s6-init and s6-svscan).

I don’t remember where I’ve read that, but the thing systemd was accused of was being written in the same way “applications” are written, rather than being written like system software, i.e. not minimal, tightly integrated to the point of being unable to remove bits from it and replace it with others and making use of other processes that should never be used if you want the OS to be stable (like using dbus for low-level stuff, when dbus is designed for the higher-level stack programs).

It sounds like you guys might be interested in suckless software (I think the things I’m using from that list are nnn, sxiv, st, mpv, mupdf, oksh, abduco, dvtm, yt-dlp and I might at some point try stagit and maybe scron if it has an anacron support - ok, quite the list, I must say).