News for hackers. Stuff that matters.
Re:Why systemd is still divisive after all these years by ssivark on Thursday June 18, 2020 @06:01PM (#23568613)
I also feel that it’s useful to take a pragmatic perspective on what an init system must cover. As someone who uses linux on the laptop, everything from boot to getting to a usable desktop is part of the “init” as far as I’m concerned. And I love the fact that there is a unified orchestration of all the necessary details (hardware devices, network connections, etc/whatever) to get me to a nice working environment fast. I don’t see what is there to complain about that!

Also, I find it strange how folks randomly get hung up on “Unix philosophy” without consistency, or regard for relevance (Per the Unix philosophy, you should not be checking email on a browser meant for webpages). It’s not like Unix is some pinnacle of system design. It was a good thing for 50 years ago, but our computers and our needs have evolved significantly since then.

Re:Why systemd is still divisive after all these years by danudey on Thursday June 18, 2020 @07:43PM (#23569405)
Here's my hot take: systemd actually embodies the so-called "UNIX philosophy" better than any of the other alternatives.

The UNIX philosophy is theoretically "do one thing and do it well", but in practice means "create small, composable pieces which can be used together or separately to accomplish what you need."

"systemd" the project is certainly huge and all-encompassing, but you could say the same thing about GNOME, the GNU project, or even GCC itself. The systemd project, however, is divided up into a ton of smaller components, all of which are relatively easy to understand in isolation and which almost universally have clear interoperations with each other.

Case in point: systemd ships two components, systemd-networkd and systemd-resolved. I typically reconfigure my systems to use these, as I find the documentation simple to understand and the config file easy to write by hand, even from memory. Compare this to, say, netplan, which I've never actually googled a full list of options for.

That said, both of them are optional, and Ubuntu 16.04 for example used systemd in what was apparently as few places as possible, notably not using systemd-networkd or systemd-resolved. They were easy to enable and use, but they were by no means necessary.

LIkewise, systemd ships systemd-machined, a framework for creating "machines", which are containerized systems which operate like virtualized systems, with their own copy of (probably) systemd running inside.

The systemd tools, like systemctl and journalctl, can interact directly with these machines, meaning that you can use the same tools on the same command-lines to access what is effectively a "containerized" system's logs in the same way that you would locally. Likewise, systemd-networkd has configuration to automatically bring up their network configs as soon as they're created, without having to do anything manually. Again, it's not shipped by default and definitely not enabled by default.

In this way, I would say that systemd actually embodies the so-called "UNIX philosophy", by creating a bunch of separate daemons and systems, all of which can work well together but few of which are inherently required by each other. It also adds a ton of functionality which is effectively impossible to add to existing init.d systems in any maintainable way (like spawning processes in their own cgroups and namespaces, creating ephemeral users with arbitrary UIDs for those processes, creating private /tmp directories for individual services, adding bind mounts, restricting syscalls, mounting the root filesystem read only, and so on.

In essence, systemd gives you all the tools you need to build up whatever system management you want, but if you just want "execute this binary, which will not fork, and keep it running" then you can do that too, without any of those extra features getting in the way.

Re:Why systemd is still divisive after all these years by bcrl on Thursday June 18, 2020 @08:58PM (#23569913)
If systemd was written by someone with just a bit more taste in structure and APIs, I might believe you, but that just isn't the case. Why do I have to wait for several minutes to boot or reboot my machine when something goes odd with one of the services (like dns not working due to a transient network issue)? Why was ntsysv and chkconfig support (the baby) thrown out with the bathwater until almost a decade after systemd was introduced? The author has consistently demonstrated that he does not have the ability to make decisions that take into account the sysadmin / end user experience when things go awry. That's what frustrates me about systemd. At least I was able to debug the shell scripts that shipped with sysvinit. These days I have no control over that part of my machine.

Fwiw, the same disease infected gnome a long time ago as well. One day my key bindings surprisingly changed from unix to windows style in an update. Then I lost the ability to customize the widgets surrounding windows by the window manager. Control over focus follows mouse was lost... It drove me away as a user because my preferences were no longer worth supporting.

I guess I'm just turning into a grey beard at this point. Sigh.

Re:Why systemd is still divisive after all these years by SahAssar on Friday June 19, 2020 @07:08AM (#23573185)
> Why do I have to wait for several minutes to boot or reboot my machine when something goes odd with one of the services (like dns not working due to a transient network issue)?

Because one of your other services has said it depends on network.target/network-online.target and is in the critical path of your boot. Check which one with "systemd-analyze plot > plot.svg" and "systemd-analyze dot 'network.*' | dot -Tsvg >network.svg". You can also see the critical chain and which parts block faster boot with "systemd-analyze critical-chain".

I think if you stopped expecting systemd to act like something else and instead treated it like the toolkit that it is you'd see that it does what it says it does quite well. Those issues with boot you mentioned are often that the distro ships a bad systemd config for a certain program.

Re:Why systemd is still divisive after all these years by bcrl on Friday June 19, 2020 @09:26AM (#23574305)
Why do you think systemd is defendable for this? The prior init system had a means by which individual init scripts could be disabled during boot. I can't run systemd-analyze when the system off in lala-land for 5+ minutes. Moreover, if I know what is wrong, why can't I just cancel the job it's waiting for like I could previously from the console? It is a unacceptably bad user interface experience. There is no excuse for it. Again, this worked previously - why was this functionality lost / hidden? It's this "punch the user in the face" style of user interface design that I object to that is so prevalent in the corner cases of modern UIs.
Re:Why systemd is still divisive after all these years by SahAssar on Friday June 19, 2020 @10:31AM (#23574885)
A service has been configured that to say that it won't start until the network is up. Another target, your user interface has said it depends on the previously named service.

What is the correct action for systemd to take here? After a timeout it will do what you said it will do, but until then it will try to do what the configs have said it should do.

You can tweak this however you want. You can shorten the timeout to whatever you want, you can change the dependency graph so that particular unit does not depend on the network, you can disable it completely.

> It's this "punch the user in the face" style of user interface design that I object to that is so prevalent in the corner cases of modern UIs.

I don't understand what you mean here, it was configured to do one thing, and it did that thing. You can of course say that it's a bad config (which is probably true), but then it's either the distro, the packager, systemd's defaults (which often are not ideal) or your own customizations. I'm all for arguing about better defaults in systemd and making distros better config their packages, but the actual systemd init seems to have done exactly what it was told to do here. Again, I'd like to say that distros/packages/users of systemd treat it like a pure init and often don't use it as intended.

> I can't run systemd-analyze when the system off in lala-land for 5+ minutes.

If the tree of critical services for your boot are that broken I'd assume you need to boot into single user mode or use a recovery usb. But if you actually boot after those 5min I'd expect you to easily find where those 5mins where lost using the tools I mentioned above, which is more than I can say for previous inits.

Re:Why systemd is still divisive after all these years by bcrl on Friday June 19, 2020 @07:39PM (#23580027)
Why does login on a console terminal depend on networking being up? It's a false dependency, one decided upon by the developer of systemd. And it was a poor choice. The mindset that "it's configurable" is inexcusably lame. That mantra allows bad developers to get away with not putting in the work of thinking about and understanding how users experience their software. It also allows rewrite-the-world projects to take off and throw out all the knowledge that is implicitly present in an existing system before having understood why that complexity came to exist in the first place.

Those who do not try to understand history are doomed to repeat it. That has clearly happened in the case of systemd and is why I don't think the attitude it presents towards end users is at the level that such a core piece of infrastructure should display.

Re:Why systemd is still divisive after all these years by SahAssar on Saturday June 20, 2020 @05:07AM (#23582767)
I'm guessing it wasn't the systemd developers that configured it as such, but without seeing your dependency graph and knowing your distro and installed packages I don't know.

Maybe your distro supports LDAP or another remote user directory? Maybe you just have some services installed that depend on the network and that say they are critical to the multi-user.target? You haven't given enough info for me to know, but it probably isn't systemd's fault in this case.

Re:Why systemd is still divisive after all these years by bcrl on Saturday June 20, 2020 @01:46PM (#23585294)
The distro I use is developed by the company that employs the primary systemd developer. Do you really expect me to believe your assertion that he holds no responsibility for how systemd is shipped by that distribution?
Re:Why systemd is still divisive after all these years by SahAssar on Sunday June 21, 2020 @07:59AM (#23591534)
Well, if you used the tools I mentioned you'd know who/what configured your system that way and how to fix it.
Re:Why systemd is still divisive after all these years by dirkt on Friday June 19, 2020 @02:08AM (#23571498)
> but in practice means "create small, composable pieces which can be used together or separately to accomplish what you need."

Except they are not composable on a package managing level. At least they weren't Debian, back when I tried.

You cannot just pick some. Update a wrong package, and the whole systemd monolith came in via dependencies, throwing out the old initd system.

Add to that the amount of new bugs that always come in when you write something new, and you have a very unpleasant experience.

Add to that the "I don't care what other people think, I do it MY way, and now you all also have to do it my way, if you want or not" attitude, and I switched to Devuan and never looked back.

Systemd has lots of goods ideas. And the existing alternatives are really sucky in places (but at least you know where they suck, can can deal with it).

If they really had written a small init system, and allowed pick-and-choose replacement of other parts, it would have been awesome. But they didn't.