253 points · by sysoleg · 4y ago · 317 comments
I am considered a Linux expert in my field but the truth is that I really don't know how systemd internals work well enough to read that review and fully understand it. The review did teach me some things about what Units really are, more than just services and timers, but other than that it was too deep for me.
And yet I work full time with Linux systems, building services on Linux systems for major clients and government contracts.
From my perspective as a user and operator of Linux, systemd has been nothing but good things.
Also upstart, which was actually pretty good, but systemd was more ambitious.
If you spend an afternoon installing it and configuring a few network services, you’ll already know most of what there is to know about how init used to work.
It used to be extremely elegant and robust.
The main flaw in the design was that the “service” files were written in a Turing complete language, which meant that distribution maintainers could ship things that were arbitrarily terrible, and many chose to do so.
(Edit: Also, the organizations that somehow couldn’t figure out how to use and maintain traditional init systems were the ones that produced the current generation replacements and pushed them so hard.)
For example, one of my Void flavored machines is using runit: 11 tasks; but a freshly booted headless Debian using systemd: 95 tasks... and that is with a massively slimmed down, purpose built, kernel. Abstractions atop abstraction... the amount of waste in the pursuit of generality has to stop - if this silicon shortage doesn't do it nothing will.
A normal user will never really link the features they see or do not see back to the init system. I'll draw a parallel with the worst subsystem being cut out of modern Linux - X Windows.
As far as I can tell Linux is missing good macro systems that can record actions taken by a user, then replay them. For loops for non programmers, basically. This isn't because the idea is radical, but because implementing the vision historically needed a programmer to understand X - which is too hard. There is a hidden link between the subsystem being awful and programs not existing.
Similarly, the monoculture created by systemd is influencing how the future of Linux evolves by making some things easier and others harder. End users won't be able to detect those influences though, and unlike X's problems systemd is likely a net positive. Systemd easily improves on the old init scripts.
systemd became the de-facto default init sys because Distro Maintainers have chosen it. I posted this link here before, but I will happily post it again: https://www.reddit.com/r/archlinux/comments/4lzxs3/why_did_a...
Such a thing doesn't happen if the thing offered isn't an improvement over what was before.
As a matter of fact, this doesn't even happen if the thing offered is only a small improvement. We have seen this time and time again in Programmig languages: Exciting, clever new things that offer real advantages vanishing into obscurity because while they were better, they were not better by a large enough margin.
Diversity is great if it offers advantages. Different kinds of RDBMS are a good example. Different kinds of shells. Rust being there as a C alternative, Go being there as a Java alternative, Julia as a possible Python alternative, WASM instead of JS. All great.
But keeping something mainstream just because its different, adds no value. People can and do still use other init systems, but I am very glad I no longer have to wrestle 400-line sh init scripts on my production servers.
It does happen sometimes. GNOME3 and GTK3 didn't offer much to Linux desktop users, yet they were adopted.
And improvement is subjective. Maybe systemd made maintainers' lives better. But it also introduced big nasty software full of bugs that discourages hacking by users. Many users consider that a deterioration of the Linux ecosystem.
I'll take wrestling a bug in a 400-line shell script to wrestling a bug in the systemd C code and compiling my fixed version.
Because they were forced to choose it due to vendorlock and many other projects became dependent on systemd. Unsystemding everything would be very expensive.
Same problem will be with snap and flatpak.
While I agree with the broader point about (any) monoculture, I don't think that this can be blamed on systemd.
Systemd did not itself create the monoculture. When it came up, it was one of a multiculture. Distro maintainers then chose it en masse so that it became a de facto monoculture.
I'm not saying that necessarily makes it the best choice, though.
On a slightly different note, I find such comments funny in a way, because one of the reasons given for Linux's lack of market share on "the desktop" and, broadly, as a platform for "enterprise" software (think Adobe, etc.) is because the ecosystem is so fragmented. So, essentially, the platform isn't considered because it's not a monoculture (as would be Windows and Mac).
yes, it's still open source, but modifications and inspection are far more complicated creating a much higher barrier to entry.
in the earlier days when it was still buggy, even linus himself was screaming about not being able to easily take the case off of pid 1 when it misbehaved.
Personally, I was more of a fan of upstart then systemd, but both were a massive improvement over sysvinit in terms of offering an actual interface with abstractions for the things you wanted to do. This is again from the perspective of a user, but that's where (in my opinion) most of the cost/benefit was anyway.
A monorepo containing well-organized boring C, developed on github of all places, is the polar opposite of raising the barrier to contributing vs. what was replaced.
Full-disclosure: I contribute to systemd.
To me, the most poisonous example that contrasts the traditional design with Freedesktop's design is acpid contrasting logind. In the former case, an acpi event is sent, and acpid simply executes a file such as `/etc/acpi/action/lid_down.sh`. That file can contain anything the system administrator wills, from a simple script that does nothing more than `systemctl sleep` to whatever complex task he could desire.
The last time I checked the situation, logind had replaced this powerful, and simple mechanism with a configuration that offers nine options to execute when the lid is pressed, none of which involve executing a simple file. Of course I can edit the source code and recompile to allow it to do what I want it to, but I would far rather simply quickly alter a simple shell script to do so.
And luckily I can, because I do not use logind but acpid, but that does not change the ire I experience when dealing with many Redhat and Freedesktop people who make it very clear that I should be using logind, that it's better, and that they create artificial dependencies on it to as Poettering calls it “gently puh” me in that direction.
But, like some other comments have said, I was young enough to dodge the drama. I basically grew up with systemd and I don't feel like I'm missing anything. The biggest problem I have is that Ubuntu Server defaults (or used to default) to having the system wait on network interfaces, which is annoying when I want to build a desktop off of it. And sometimes on shutdown it waits for some daemon I don't care about to quit. Which is probably just a bug in the daemon.
I would argue that locked and pentalobe metaphor is not very accurate - systemd is no more locked than most other open source software.
Systemd may indeed be somewhat more complex, but I don’t think that it would employ many accidental complexity— it is complex due to the problem domain. But imo that is a worthwhile thing to spend complexity budget on.
I’m waiting for Microsoft to buy Red Hat. Failing that, IBM.
The UNIX philosophy isn't meant to be taken as gospel - hell, it's very hard to define what "doing one thing" even means.
There were several init replacements in the mainstream before systemd. OSX and Solaris both had their own, and they were as UNIX (officially certified) as you can get.
Also, as long as we're doing non-sequitors; Microsoft is more likely to buy Canonical than they are to buy RedHat or IBM.
There is absolutely no need for its command names and everything else about it to be so counterintuitive.
Exactly this, yes; and that's why it was pushed the way it was.
I dread the day when systemd or an init system just like it consumes the BSD world.
Git has the same problem but at least git is excellent enough software in other ways that it makes up for the horrible UX. Systemd is mediocre.
So far. I hope for your sake it continues to be so.
I actually appreciate, now, what systemd is trying to do, but I am not certain why it has to take over home directories and everything else to do it. And I am really uncertain why it has to have such bad taste. I can get why it uses C, even though IMHO that is a mistake. But .ini files? D-Bus? XML‽‽‽
Oh well, at least it's not YAML.
People didn't like the way systemd developers pushed the community to adopt systemd, specially when they asked for 3rd party developers to make systemd a hard dependency.
Unfortunately,people don't remember this today, and think users resisted to systemd adoption only because they didn't like systemd.
I’m old enough to remember the culture wars and even older to remember a well thought out approach to overall configuration in Debian given the available tools of the time.
Note I said “good” documentation - many Linux systems have lousy documentation and they lack an obvious, sanctioned way to do it. Again, that’s the problem.
Defining a straightforward configuration structure for that complexity is going to be insane. NetworkManager + Debian's /etc/network/interfaces (IMHO) seems to be a good fit: auto config w/ a GUI in NM in the simple case, and if the interface is listed in /etc/network/interfaces, you can do it anyway you want with Debian's system, with pre-up, up, post-up, post-down, etc scripts to your heart's content to setup whatever complexity you need.
NetworkManager is god awful in this regard. Even for simple desktop uses, if I want something more advanced than simply connecting to the Wi-Fi (even this requires finagling), then I'm fucked.
For example, I've been trying to find what it is that keeps overwriting /etc/resolv.conf.
After reading through various man pages and online forums, I still don't know. Instead, I just stick to one access point, and manually write to /etc/resolv.conf everytime I boot.
Compare this to OpenBSD: nothing fucking touches my /etc/resolv.conf. That file is mine. I write to it and other daemons read from it.
What specifically is a pain? Have you used it recently?
Maybe my end-user desktop network requirements aren't complex enough but it's been pretty damn smooth in my experience for the last few years. I used to avoid network-manager with wicd, but now it seems pretty stable. I use the network-manager and network-manager-gnome packages to get the toolbar thingy in i3wm, it's very simple to use. I also combine it with wiregaurd using the wg commands.
Are you doing something more sophisticated like routing traffic? or something else in a server context? I literally can't recall having a single networking issue that was Debian's fault over the last few years, throughout using lots of different APs.
[1] I'm a developer who can admin a Unix system if forced to, but how to administrate Unix has changed at least three times since I first learned in the mid 90s, and I'm tired of the constant changes (shakes my old-man fists at the sky).
Wonder if it solved it. If not, what's the fuss.
It's like somebody decided that the problem with Linux was it wasn't complicated enough. And then everbody just went with it.
I find it much easier to reliably accomplish non-standard things with systemd unit definitions, than it used to be with the ill-defined complex set of shell scripts we had before.
systemd management of mounts can be similarly narrow about the types of configurations it supports, and systemd-firewalld just sort of openly only claims it can support simple use-cases.
systemd-journald is also a net loss of flexibility compared to rsyslog but, on the other hand, rsyslog could quickly turn into an inscrutable mess if you used any of the advanced features (rainerscript...), so this may not be an entirely bad thing.
And in general systemd is, well, opinionated. I hate to bang on resolved too much but I just happen to have spent quite a few hours last week figuring out resolved problems. Resolved does not handle "dotless" domains correctly in a lot of existing environments (it's very particular about exactly how the search domain is set up). Poettering has basically responded that it's because dotless domains are stupid and no one should use them, so it won't be changed. I don't necessarily disagree that dotless domains are not a good idea today but it does mean that resolved breaks a lot of older corporate and institutional environments that have been using them successfully for decades. This manifests as "I updated my distro and the intranet stopped working." That kind of breaking change is not very common with core Linux services and isn't going to make many friends in the IT crowd.
Consider a situation, where your sh-backed SysV init was missing some function you required. Something between start-stop-daemon() or ifup(). You could throw a bunch of shell commands (note: most shell "programmers" are not capable of doing it properly; they do some '==' comparisons in /bin/sh shebang, don't handle errors, ignore fact that variables might contain "funny" characters etc. - but in general most of the scripts I've seen during my 24 years in Linux was simply badly written, meaning at least using bashizms). And then ...you watch out for every single package update that would overwrite your changes. Or you could polish them and try to push upstream.
Now the situation seems to be worse - you can't just edit some random file to add missing function, you need to write it in source C files and recompile. Not a way for quick and dirty solution.
But instead, you can simply write the same (s)hell commands in a script and call it from appropriate unit. No messing with thousand-lines scripts, no risk of overwrites, no need for upstreaming.
I’m sure there are many other examples.
Honestly, even after 10 years, I still have’t had a single positive interaction with it vs. traditional init. From what I’ve seen, old-school init handled (and continues to handle) the problems systemd “solved” more robustly and elegantly. I don’t get it.
[citation needed]
I remember spending days reading the arguments on the Debian mailing list. There was no push from systemd devs. (Endless threads about upstart, how tweaking upstart would solve everything and it's already in Ubuntu, and a lots of questions about guarantees. Are openrc/upstart/systemd maintainers willing to guarantee this or that? And as far as I remember, there were no guarantees, obviously.)
Before that when the hwdb and udev merged into systemd, people got the pitchforks out, it was the decision by Kay, but obviously "systemd devs" were somehow behind it.
When Greg KH supported kdbus, somehow it was again those meddling systemd devs.
Somehow OSS veterans just lost their agency overnight and became puppets? Nah.
We are talking 10 years ago, not 1975 here. Unless everybody is 25 years old on HN...
Random system breakages for stupid reasons.
And everything hardcoded the ugliest way possible so that it is impossible to have alternate systems like some embedded ones.
Do you have any links for these statements? My memory is not great but I think I would remember anything similar to this.
quote:
"What most systemd critics consider "bloat", I consider necessary complexity to solve a complex problem generically."
endquote
This is par for the course for what's essentially prototype-quality software that's trying to address a number of non-trivial issues - but let's not pretend that real improvement is not possible here, or that systemd-as-it-currently-is does not stray from what's often called 'the UNIX philosophy' or 'the art of UNIX programming', of which separating mechanism from policy is a key component.
Can you please elaborate on this? It sounds like a very desirable approach, but I don't really see it "in unix". (I can think of a few program suites that use processes and piping between them as the "protocol", eg. cups, the executable files in a directory that are then launched in a loop pattern is more common, but that seems to lack the policy part. Whereas OpenSSH for example lacks this.)
I don't want to hear anything about stable or production systems or debugging from arch maintainers. Every so often I forget the journalctl and coredumpctl command line flags and have to google how to do basic tasks.
[1] https://bugs.archlinux.org/task/73002
EDIT: and before someone asks me why i'm using it, it's because i lke tinkering and for the most part i can deal with these "outages" on my laptop.
Unless you explicitly disabled it, you should have old packages archived in `/var/cache/pacman/pkg`. So you can simply downgrade via `pacman -U /var/cache/pacman/pkg/python-x.y.z`; no need to go to an (possibly untrusted) archive.
I think I'm just used to the installer. I like doing everything by CLI. Ubuntu is always trying to push something odd like Snap, and I think Xubuntu is defunct. The Ubuntu installers are very opinionated on what kind of desktop they want you to have.
One of these days I'll just buy all the ThinkPenguin stuff and go to FOSS-only Debian with xfce. Debian has a great installer, too. Then I'll turn my desktops into cattle-style systems where I blow up the rootfs once a year for full system updates.
My experience with Debian system updates have been pretty good; I don't think I have ever blown up my system through them. (when running stable)
I have been using s6 on Artix and find it a great init system and service manager with a clear cut design goal of knowing where to stop. It does what it is supposed to do and no more - by design. It doesn't have the user friendly interface of systemctl but that is being currently worked on. If one is looking for an alternative to systemd, I think it is an excellent option to consider.
I'm currently exploring how to generate minimal service environments from Guix package manifests. Being able to spawn svscan as a child under the root supervision tree means I can create each environment with its own service directory, and never worry about cross-contamination from whatever else is on the host.
I _think_ I did something similar to what you mention, though I'm not familiar with guix. Analogous to systems, what I _did_ like about systemd was the user level service management. So I essentially kick off a user privileged supervision tree for my session with s6 with its own scandir and service db when launching X. It is not under the root supervision tree but lives side by side at this moment since 1) I wasn't aware of s6-usertree-maker at the time and 2) i wanted any user to be able to kick off user privileged services without root intervention (e.g. setting up usertree-maker)
I use phusion/baseimage-docker[1] right now, love every bit of it. Having the database, web server(nginx) and the java backend all in one place works beautifully.
The only pain point is having to write `runit` scripts for startup and shutdown for each service, hence the wish for Systemd inside containers.
One process per container is indeed strange in a lot of use cases, you lose the self-contained advantage of a container...
Having said that, personally (old school) I lost 2 or 3 hours yesterday due to not realising systemd was changing things I changed for a reason.
This is one of my go-to reasons when people ask me why systemd is bad. Once it overrode power settings I had configured in xfce-power-manager. Mainly I wanted the lid close to do nothing on AC power and to sleep on battery. It started sleeping for everything after an update once. I think in the end I couldn't figure out how to get the exact desired behavior with systemd and I disabled sleep entirely.
The other reason I often mention is the ridiculous shutdown timer thing that makes you wait for minutes sometimes for some service to end.
The main advantage to systemd is that a lot of unit files were already written and packaged with stuff, including --user variants, and also that it has a user mode at all (OpenRC doesn't yet). Fairly minor advantage, imo. In general I prefer shepherd, runit, or openrc. My needs are pretty simple, though. Most of the time I just need to start/stop/restart a service, which is pretty simple in every init system I've used.
Is it something like a forgiving parser going rogue in an edge case?
The only thing I could think of is a systemd default setting that was added to logind.conf or something similar...that's why I'm asking.
Not sure if serious? At that point, how is that any better than just using Windows? "Press Ctrl+Alt+Delete 7 times" has long been SOP there.
You might be forgetting how bad it was at first. In fact I'd argue it was worse than initially feared, and the developer's supreme arrogance did little to help.
My favorite quote (and when taken in context is much less tongue-in-cheek thank you might think):
systemd is an event-driven object manager with dependency-like side effects which ‘boxes’ primitive kernel resources and userspace subsystems into a generic object type called Unit. These Unit objects are scheduled through the state propagation mechanism of ‘jobs’ and dynamically dispatched via a singleton object called Manager, responsible for launching jobs in ‘transactions’ which do merging, cyclic ordering and consistency checks and serve as the main point at which unit dependencies are pulled in. Unit startup is executed as a non-indempotent parallel dataflow with weak ordering guarantees on the job level, mostly independent of the active state of dependent units.
Any night you have insomnia, just read that a few times and you'll be out like a light! :-)
In this case however, the words are all fairly precise and accurate (at least from my basic understanding of systemd). They might not be words used in everyday conversation, but they don’t need to be unless the document is targeted as introductory material (which I don’t think is the case).
That’s not to say this is the only way to explain it, but it is a very concise way, which I at appreciate.
Sometimes, a concise, high-level overview is what you need.
- event-driven
- object
- side effects
- kernel resources
- userspace
- subsystems
- unit
- scheduled
- state propagation
- dispatched
- singleton
- merging
- cyclic ordering
- consistency checks
- dependencies
- non-idempotent
- weak ordering guarantees
And while this list is good for BS Bingo, as these terms are being used in other contexts too, the overall description of what systemd does is pretty precise for just three sentences.
“Idempotent” is one of the key words used as a cudgel in this way. It’s great for the bullshit artist, as to a layman the dictionary definition is completely inscrutable.
I think the core of the problem was somewhere between the style of introducing changes and the way how people communicated. After all, it speaks for itself that pulseaudio and systemd shared a lot of common criticism. Both are technically sound systems today, but in a way, systemd was just the escalation of the pulseaudio debacle.
Make doesn't do dependencies between unrelated projects. A makefile can't say "I want to run if X runs, but I should run before them".
Make doesn't have supervision, you'd need some kind of declaratively configured poller.
Systemd is also parallel, there's probably some complexity there that make might or might not handle well.
I think the most important problems would only be obvious once you started using a replacement system though. Systemd almost totally replaces the need for any imperative code whatsoever for process autostart, configuration, and supervision, and that might be hard to do in a more modular setup.
You don't need extra stuff besides the service file. Everything is extremely consistent and done the same way for every service.
Polling is better-addressed by having each service implement its own error handling. Restart loops are the wrong policy for most services. In the rare cases where they are actually the correct behavior, they’re trivial for the service author to implement.
Those that don’t understand make are doomed to reimplement it poorly.
Dependencies in make are equivalent to systemd's Requires= and After= combined. Systemd is far more general in this regard, both in that Requires= and After= are separate concepts, but also in that there is Wants=, BindsTo=, etc. and their inverses (RequiredBy=, Before=, etc.). Sometimes when I'm writing Makefiles I wish Make were capable of expressing some of these concepts.
INIT: version 2.88 booting
Using makefile-style concurrent boot in runlevel S.
I may try it again one of these days now that the latest Devuan stable is based on Debian Bullseye.
The "why" is simple: to restore some balance in the force.
I do prefer my Linux world to be one where I still have a choice as to which init system and PID 1 my system is running.
A very small percentage of sysadmins really care about what init system is running on their servers. If you look at who's forking distros and making systemd-free variants, and look at who the vocal anti-systemd users are, they're overwhelmingly desktop-focused users. But this is strange because desktop Linux barely needs an init system at all. The long-running daemons on a desktop Linux system only need be started on startup, if they crash, restarting them is unlikely to leave the system in a workable state anyway.
However, because server Linux dominates the Linux ecosystem discourse and distro news, people have an inflated view of how important these components are.
So my take-away has been: it's safe to ignore systemd criticism, since it's overwhelmingly coming from hobbyists who have no real use for an init system anyway.
I have had enormous issues with systemd, not when using it for desktop purposes, but precisely when using it for server applications.
As an example, systemd can't handle a service which depends on a specific network interface (or specific bind address) before being brought up and the systemd developers blame the software for not listening to rtnetlink events or not relying on linux specific socket options[0]. This is unacceptable, it makes it incredibly difficult to run systemd on hosts connected to multiple segregated networks without lots of dirty tricks involving firewalls.
[0]: https://www.freedesktop.org/wiki/Software/systemd/NetworkTar...
Also, don’t get bogged down by systemd-* services, they are related but are usually not part of systemd at all.
I'm generally a fan of simple systems that don't do much controlled by simple text files. Maybe systemd is way better at runit for more complex workloads than a desktop or a simple server. But maybe it isn't. The intersection of people who like systemd and have tried runit is probably quite a small one!
See lively discussion from last time: https://news.ycombinator.com/item?id=23062072
Systemd, ten years later: a historical and technical retrospective - https://news.ycombinator.com/item?id=23062072 - May 2020 (432 comments)
and:
Systemd, 10 years later: a historical and technical retrospective - https://news.ycombinator.com/item?id=23204666 - May 2020 (59 comments)
(but also, it's true, people tend not to use HN search before posting)
But you have probably thought of this already and didn't do it for a good reason.
In this case I hadn't seen it before so it was news to me.
Back when I had linux as a desktop (around the day of slackware 10) there were plenty of problems with simple stuff like mounting usbs, connecting to wifi etc--possible but a pain. I've hardly looked at systemd or linux in such a way for a long time, however.
I am actually optimistic that in another dozen years or so Wayland might be pretty nice, but I certainly wouldn't consider it an examplar today.
My preferred WM is evilwm. I read the entire source to it in a few hours, and occasionally edit the source when I want to customize it for my odd workflows. I don’t think that’s possible with wayland.
Also, wayland forced a bunch of questionable security policies around screen capture and keyboard handling, and didn’t provide escape hatches required for basic functionality. Is that fixed yet?
I stopped paying attention years ago, to be honest.
KDE and Gnome have their own wayland implementation but this isn't really a problem. You can still write you minimal WM because their is a project called WLRoots which does the same job as the old x11 package. It lets you trivially interact and be compatible with the wayland spec without having to implement it yourself.
Screen capture and keyboard privacy is essential for the future of linux IMO. I don't know the exact state of it but I did not have any issues screen sharing with wayland compatible apps. There were some issues with x11 only apps but I think PipeWire solved that.
The security policies are not questionable. XServer is beyond fixable. A single rogue extension can screen share everything you do to a remote server, you would not even recognize that.
Well, the wayland protocols are very poorly documented compared to X. But most WM's have to support a bunch of obscure X extensions to get a reasonable featureset, that bring in much the same complexity as Wayland.
SystemD is essentially forced (for better or worse, not gonna argue) because it is a hard dependency for certain software and tightly integrated with other tools in the systemd ecosystem
It is opaque because I cannot read, modify or understand what it’s doing without breaking out gdb, heaven forbid I want to alter its behavior in a less than approved way.
This leads to weird situations like the MySQL unit executing a bash script to run: because systemd has limited preflight checking compared to alternatives.
Before someone claims I want sysvinit back: No, I don’t want that. I would simply prefer systemd to be smaller so that we can replace it with something better or more tailored should the need arise.
We’re locking ourselves in to prototype level software (which we best into working semi decently) with obstinate leadership team who deny any faults.
In this respect I think that systemd is really a victim of the Unix kernel/shell style, where 'kernel' is read expansively to mean 'everything in C' and 'shell' is read to mean '/bin/sh'. The problem is that where shell is easily examinable and understandable for most technical folks, compiled C simply isn't (yeah, yeah, we all know someone who can debug in assembler; that guy ain't me).
It would have been nice to have had one system, with a typesafe compiled language. Scrutable, fast and safe. We have an example with emacs: one can always just M-. to a function's definition (even in the C core …).
It's a real pity that systemd hadn't been written in Common Lisp or some similar language.
Perhaps at some point they'll switch to something that's established instead of maintaining their own IPC protocol.
- GDBus, if you're developing for GNOME
- QtDBus, if you're developing for KDE
- sd_bus, if you're writing low-level C
- zbus, if you're using Rust
For other languages, you'll want to look for bindings to one of those libraries, instead of bindings to libdbus.
Excluding the kooks angered enough to send hate mail to the systemd developers, I can understand the old criticisms and aggravation from sysv folks. I was front and center as a relatively new user of Fedora at the time systemd was adopted. While I was familiar with sysv, I wasn't attached to it. I also found sysv a lot more confounding and obscure than systemd in the early days, even though the transition did have rough spots. But I'm definitely attached to systemd now.
[1]Linux Service Management Made Easy with systemd:
https://www.packtpub.com/product/linux-service-management-ma...
- The developers had a condescending approach and ignored the wider community.
- Simple things like log files no longer being plain text. Obtuse.
- Arguably designed to inject unneeded complexity that will cause money to flow into big orgs. 1.2 million lines of code vs shell scripts. Just wow.
Wow. I had forgotten how ropey early Linux was. I mean, I rip on Windows folk about early versions of Windows prior to 98SE or NT4 (and can recall having to install Winsock on a home Win95 install and thinking why the hell????) but finding out 30 years later that my early struggles with Linux were not entirely down to my own incompetence is ... refreshing. I mean how do you Google (ok in those days Altavista!) a "how to" if the network stack is borked? How do you even download the drivers or updates if the interface fails to come up?
It sounds silly but I'm so glad to know it wasn't something I was doing wrong on my end. 30 years later and dayamn!
k3s could stop everything, but it doesn’t. It’s a design decision.
Under crio to stop all containers you can (well, should but YMMV depending on any changes we’ve made recently)
systemctl stop kubepods.slice
Note that doing that a subsequent start shouldn’t bring the containers back unless k3s and crio were both running (the transient units don’t survive restart).
Note: there’s tons of complexity here that has changed over the last five or so years as container runtimes evolve, so if anything I said is wrong now it was right at one point and might actually be a bug.
Kube for instance didn’t use to gracefully shut down containers on node reboot, and over last few years we’ve gradually fixed all of the complexities so that you do get the correct shutdown behavior between systemd (which takes the “power down” input) to the unit (which encodes how long graceful shutdown should take based on the pod termination grace period seconds) to cri-o (which has to set the correct behavior in systemd) to kubelet (which has to stay running to keep updating the API) to the other components on the node (like container networking, which needs to stay up until all pod network pods are done).
systemd makes a lot of that a lot less painful than it would without.
At one point some distributions accidentally configured the sshd or cron unit to do that. People were a bit surprised when restarting sshd or cron killed every single background child process.
See https://www.freedesktop.org/software/systemd/man/systemd.kil...
Not to mention if k3s is just managing containers running under docker or containerd, those processes are not parentless just because k3s stopped.
Chances are the k3s service unit specifies something else (like 'none') - whether or not that is actually wise would probably require some research.
Now k3s of course starts tons of stuff, mostly in containers. Therein lies the problem: By default, Systemd indeed tries to get rid of the entire process tree. It does this using control groups (cgroups). Unfortunately, it is easy for a process to “escape” its control group, at least for root.
Stopping the master process could absolutely be made to also stop everything.
It would be great if k3s did properly integrate with Systemd. It doesn’t, but Systemd is not to blame for that. That’s my point.
If systemd is your init, then it manages everything. It may not manage them at a service level ala systemctl stop, but that's true of pretty much everything. Whether or not k3s brings down everything with it is on k3s. I certainly see why stopping k3s might not stop all dependent processes: it's useful for live upgrades.
However I quickly learned and then it was mostly a non issue.
I was confused when years later there was still push against adoption by other distors.
Lots of people are not surprised when you tell them that pulseaudio was created by the same author. Because it is kind of working in most cases. But there are always, aside, a lot of annoyances or things that work badly without a real justification: hard to fix and understand what is going on when it doesn't work; sometimes it decides alone to not use or not show the output/input that you want and you have no possibly to decide; sometimes it is using 10% of your CPU despite the fact that you are not playing a single sound at the moment,...
I don't care how it works and didn't take part in condemning it back then either, and I think that probably it made something better (? not that I felt it), but from a pure sudo-user perspective it is a strange ini-based tech-ridden(?) launcher to me. I've managed small networks before it and haven't really experienced any trouble that it supposed to remove(?).
Tldr: I still don't know what it is and what is it for. Servers worked before and after it, maybe that is already a good experience.
journalctl -u custom-daemon.service
(you can usually leave out the ".service", but it helps disambiguate when you have different unit types under the same name)Also, you can store plain-text logs as well if you prefer by exporting journald’s output.