Comment by theamk

16 hours ago

Except for the main pid1 process, systemd is one of the most customizeable things, certainly much more than old shell-based things. Everything is documented, can be disabled or replaced, and in such a way that the rest of the system can keep functioning, and the system upgrades don't mess it up.

A lot of people said you can edit /etc/init/ scripts, but this was pretty annoying, as the moment you upgrade the package, your package manager throws a conflict at you. It was certainly non-scaleable if you have many machines with automated upgrades. Compare to systemd overrides, where there is both drop-ins and wholesale service replacement, and system upgrades never mess with that.

Heck, even something as simple as "disable distribution-provided service" was a pain! I can't remember how many times I've added "exit 0" to /etc/default/something file, just because the sysvinit did not respect user decisions during upgrades or reinstalls! Compare to systemd, where I can "mask" the service even before it's installed.

And for deeper changes? Pre-systemd ubuntu had this this stupid "system is online" idea, and I once needed to customize this.. this was lots of undocumented reading and hacking on the script, and let's hope we did not need to upgrade. Or something like "my service X should start after NFS, but ssh should start before NFS" - this was pretty hard as well, and would cause upgrade conflicts.

Systemd has lots of problems, but the customizeability is one of their best parts. It is the only thing that I know which clearly delimits "user" vs "distribution", and gives all the power to user.

I am not sure if we are talking about the same thing. I am not saying that systemd is bad. I am saying that when a project has a hard dependency on systemd (which is not necessarily systemd's fault, to be fair), then it doesn't work with an alternative init system.

  • Right, but my point is that unlike earlier init systems, unless that dependency on pid 1 itself, there is nothing preventing alternative implementations, and in fact, there is all the support to make such implementations possible.

    To give an example, let's say a package depends on systemd because it uses sd_journal protocol, presumably because it wants to send enriched logs. That protocol is fully described (in [0]), and is actually pretty trivial to implement, on both server and client side. It even have a build-in "upgrade" mechanism (via $JOURNAL_STREAM) to allow seamless switch between base/systemd-logs, although AFAIK sd_journal_* functions do not implement it by default.

    So this brings us a question: if a program wants to provide rich logs, and it is is using a documented protocol to do so, but there is only one implementation of the receiver, is this a problem? Is the onus on the program's authors to support multiple log sending functions, or on the distributions to provide a log receiver that the program expects?

    [0] https://systemd.io/JOURNAL_NATIVE_PROTOCOL/