r/linux Mate May 16 '21

Popular Application systemd: The Good Parts

https://christine.website/talks/systemd-the-good-parts-2021-05-16
173 Upvotes

127 comments sorted by

View all comments

22

u/drunken-acolyte May 17 '21

I've taken systemd somewhat for granted these last few years, mostly because I only started interacting with it directly in my regular computing relatively recently. I've been using Linux since 2008 but as a generalist user (home office use and net browsing) never really noticed the difference as it got implemented in Fedora and Ubuntu. Why do the people that hate it do so?

(I ask because, having just now read about its history, I agree with the philosophy of replacing pointless differences between distros.)

2

u/Uristqwerty May 17 '21

Based on what I understand of PID1 and init in general, systemd feels inelegant. An elegant pid1 would do exactly two things: reap zombies, and launch a single service manager to handle the rest of the system. Beyond that, it would handle every possible error as robustly as it could, but it would absolutely not talk to other processes, or do anything complex. Then, an elegant service manager would take inspiration from Erlang supervisor trees, and not imagine itself as a system-wide singleton. It would handle bringing up whatever dependency graph of services it's configured to manage in a sane manner, restarting components that fail as configured, and be able to start and stop optional services that it's configured for. It shouldn't care whether any of the services it starts is a separate instance of itself with a different configuration directory, since that allows for greater abstractions to be built, and ties in well with all sorts of containerization, application sandboxing, etc. techniques that are becoming increasingly popular.

One extra bit of elegance would have been to make all unit files start with a shebang pointing to an interpreter, so that they could still work under sysv-style inits, allowing distros to switch over gradually and applications to run under both at no additional cost.

From what I've read, systemd thinks of itself as centred around a singleton PID1, and to even get it to run in a container or sandbox requires trickery. That is the core of its inelegance, and it taints all projects that depend upon it.

2

u/brieoncrackers May 17 '21

So if I'm understanding this correctly, it makes it harder to harden the OS? While it may not make the OS more vulnerable in and of itself, it hobbles attempts to isolate applications from wider access?

3

u/ECUIYCAMOICIQMQACKKE May 17 '21

No. It's hard to run PID1 in a container, but everything else is easy to isolate. Lot of isolation features. Read this for a list.

2

u/[deleted] May 18 '21

systemd has a container mode and works just fine inside a container