TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Systemd: The Good Parts

364 pointsby goranmoominabout 4 years ago

25 comments

ohaziabout 4 years ago
I actually like using systemd. I took the time to learn how to use it, and as a desktop Linux user, it&#x27;s honestly quite nice.<p>But the one thing that still really pisses me off about systemd-the-project was the fact that they ate udev-the-project. In my view, that decision was unnecessary and was done for purely anti-competitive reasons.<p>If you&#x27;re not familiar, udev is basically the user-facing device manager for Linux. It&#x27;s what allows you to easily configure rules and permissions for all the USB devices that you plug into your computer. These devices still need kernel drivers, but udev is how you tell your system &quot;Please let user ohazi use this device, and also give it a convenient name like &#x2F;dev&#x2F;someDevice0&quot;<p>By devouring the udev project, the systemd maintainers have guaranteed that dealing with USB devices on non-systemd systems was going to be a giant pain.<p>Then came the forks -- Gentoo maintains eudev, which is a systemd-free fork of udev. But really, this shouldn&#x27;t be a fork. Udev should be independent and available on all systems. If systemd wants to do something special with devices, they should use udev APIs like everybody else. In my view, this is what finally allowed systemd to win the init war, despite all the protest. Ideological arguments about how best to start daemons is one thing, but you simply can&#x27;t use a modern system without a sane approach to USB.<p>Edit: It seems that some of my concerns were overblown, e.g. you apparently can run udev without systemd as pid 1. Udev has a build-time dependency on systemd, but not a run-time dependency. The eudev fork removes that build-time dependency, and (maybe?) also papers over some other inconsistencies. I&#x27;m pleased that this is the case. I&#x27;m annoyed that the discourse around systemd&#x2F;udev has been muddy enough to lead me to incorrect conclusions (and I&#x27;m aware that the original version of this comment likely added fuel to this particular fire). Oh well... live and learn.
评论 #27181418 未加载
评论 #27176913 未加载
评论 #27176821 未加载
评论 #27176599 未加载
评论 #27177345 未加载
评论 #27176548 未加载
评论 #27176538 未加载
评论 #27176660 未加载
评论 #27178054 未加载
评论 #27176960 未加载
AshamedCaptainabout 4 years ago
I have a system where systemd decides, about half the times I boot it, to immediately unmount all of the filesystems listed in fstab literally right after having finished mounted them as part of the regular boot process. All of this with other daemons starting in parallel.<p>It will fail to unmount most of the filesystems, since they are of course busy, but often it will succeed in unmounting &#x2F;var, &#x2F;tmp, &#x2F;home and others. Then it will continue starting on further services as if nothing happened and even proceed to gdm. But of course without &#x2F;home I can&#x27;t even login.<p>No idea how to even start debugging it.
评论 #27176644 未加载
评论 #27176288 未加载
评论 #27176299 未加载
评论 #27176317 未加载
评论 #27176318 未加载
评论 #27181750 未加载
评论 #27176511 未加载
评论 #27176294 未加载
评论 #27181481 未加载
评论 #27176301 未加载
GekkePrutserabout 4 years ago
I don&#x27;t agree with her sentiment that alpine should adopt something similar. The whole reason I use alpine is because it doesn&#x27;t use systemd.<p>I like alpine because it uses a simpler, lighter approach. It&#x27;s not for everyone, and I&#x27;m pretty sure alpine maintainers don&#x27;t intend it to be for everyone. It serves its niche really well as it is. For those who like systemd there&#x27;s many distro choices already.<p>Edit: As detaro mentioned in another comment ( <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27176391" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27176391</a> ) they are actually working on something, but they aim to solve the various issues around alpine that don&#x27;t fit well with alpine&#x27;s philosophy. It sounds like a good story and I&#x27;m open to this idea. The main reasons I don&#x27;t like systemd are its complexity and its dbus reliance, basically bringing too many desktop paradigms into all Linux systems, even servers and containers.<p>So about my above point: I&#x27;m open to it adopting a service manager but not too similar to systemd :)
评论 #27177597 未加载
jphabout 4 years ago
&gt; By not having something competitive Alpine is less and less attractive for newer production deployments.<p>Alpine uses OpenRC (<a href="https:&#x2F;&#x2F;wiki.gentoo.org&#x2F;wiki&#x2F;OpenRC" rel="nofollow">https:&#x2F;&#x2F;wiki.gentoo.org&#x2F;wiki&#x2F;OpenRC</a>). IMHO Alpine and OpenRC tend to make production deployments more predictable and reliable, because of deliberately simple init ordering, as well as a smaller surface area as compared to systemd.
评论 #27176391 未加载
评论 #27176978 未加载
ChuckMcMabout 4 years ago
Okay, I&#x27;ll admit I was hoping for a blank web page :-). Not a fan.<p>I always ask &quot;&quot;What problem is this trying to solve?&quot; and then &quot;Is this a good solution for that?&quot;<p>I appreciate the &quot;startup dependency problem&quot; and when I was in the Systems Group at Sun we worked with AT&amp;T on their solution which was the whole &quot;run level&quot; thing.<p>And I appreciate the whole &quot;shell scripts can do <i>anything</i>&quot; problem that just using a naming scheme on shell scripts to run can lead to unexpected behaviors.<p>From an architectural taste perspective, I prefer systems which are more comprehensible in parts and thus don&#x27;t try to abstract out semantics to the point of incomprehension.<p>So at the end of the day, something with a better model, better visibility into its operation and configuration, with a way to validate and debug dependencies would be good. But I haven&#x27;t been impressed with systemd.
评论 #27176811 未加载
评论 #27177295 未加载
评论 #27180827 未加载
评论 #27176964 未加载
ape4about 4 years ago
1. You don&#x27;t have to clone then modify a 100 line bash script for a normal daemon&#x27;s &#x2F;etc&#x2F;rc.d&#x2F;init.d script.
评论 #27176228 未加载
评论 #27176953 未加载
评论 #27176409 未加载
评论 #27176239 未加载
评论 #27176124 未加载
xenaabout 4 years ago
Author of the talk here. If you have questions for me please feel free to reply to this comment with them.
评论 #27177142 未加载
评论 #27176432 未加载
评论 #27176483 未加载
评论 #27179373 未加载
A4ET8a8uTh0about 4 years ago
&quot;I hope Alpine ends up with something similar!&quot;<p>Direct quote from the website.<p>Eh, no. There is already a short list of viable non-systemd candidates. We.. well.. I don&#x27;t need less. It already feels like I am transgressing some law by typing this on PopOS.
评论 #27176321 未加载
评论 #27176183 未加载
memcoabout 4 years ago
&gt; If you need to reboot the server right now for some reason, will that service come back up on reboot?<p>I didn’t see this discussed more after it was asked, but I could use some pointers on how to answer this question since I have a service I wrote that I think should start on reboot, but has to be started manually. It would be nice to know when I have fixed it without having to reboot after each change to just to test. Anyone know how I can do that?
评论 #27176275 未加载
评论 #27176171 未加载
评论 #27176210 未加载
kbensonabout 4 years ago
I think systemd brought a lot of good stuff to the table, but I also think it&#x27;s a sprawling mess with poorly named and documented (as in there are behaviors implied by statements in different config directive sections that make it hard to reason about how stuff works).<p>I&#x27;m looking forward to the successor of systemd, or at a minimum, them rolling out config syntax 2.0 which breaks compatibility in an effort to make stuff more sanely named and documented.<p>I know that would cause huge churn. I know it will never happen. But I can dream, because I don&#x27;t think anyone can look at how systemd configs define dependencies and say that they both understand the nuances and that those directives are are named sanely in a way that normal people can understand, and that&#x27;s indicative of a lot of stuff with systemd.<p>Even though it was probably designed by some of the most knowledgeable people WRT init systems, it grew organically as they discovered new things they needed, and it needed a lot (which I think just goes to show how little was really understood by anyone about how to tightly couple these things).
bfrogabout 4 years ago
Yeah it&#x27;s all pretty darn good. People forget the cluster of bash scripts, various cronz, inetd, log, and other supervisor type daemons all to do what systemd does better with a simpler config.<p>Now ask me about pulseaudio and there&#x27;s a project with nothing but issues, looking forward to the new pipewire overlords.
评论 #27176381 未加载
viseztranceabout 4 years ago
I ignored systemd because I thought it didn&#x27;t affect me, as I only run linux (fedora) on my desktop, and hardly had any issues at that.<p>But recently, when I changed my fstab file to mount a drive at boot, I made a typo. My system wouldn&#x27;t boot at all and it wouldn&#x27;t even drop to a shell so I can chroot the file system like you would with init.d.<p>I thought that there&#x27;s some arcane command I don&#x27;t know about. But there wasn&#x27;t. You&#x27;re locked off, and expected to boot off something else to fix your system. Horrible.<p>Having this said, I honestly expected way more on the section about benefits to users.
评论 #27176977 未加载
评论 #27176750 未加载
评论 #27176712 未加载
yuutaabout 4 years ago
I&#x27;m using split horizon DNS with WireGuard on my systems (I mean using special DNS servers for some domain names and the public ones for the rest. Correct me if I&#x27;m wrong). I used to try systemd-networkd and systemd-resolved because they seem to fit together. I found systemd-resolved is extremely buggy with systemd-networkd managed WireGuard. My WireGuard endpoints use domain names and systemd-networkd fails to resolve them after a manual restart. I couldn&#x27;t figure out why.<p>I also could not find a way to NOT combine split horizon DNS with network interfaces (like most documents online only include scenarios like resolving corporate domain names using a VPN interface but that wasn&#x27;t my case). I have multiple VPN connections to the same network (runs BGP basically) and I did not want the split DNS to bind to some specified interfaces.<p>Moreover, systemd-resolved seems not able to do split DNS without systemd-networkd. It needs systemd-networkd managed interfaces to do that. What? I just want separate DNS servers for separate domains. My WireGuard interfaces are managed by wg-quick. Correct me if it is possible to use systemd-resolved standalone in this case.<p>The hard systemd-resolved dependency of systemd-networkd also had issues. Sometimes, I just want systemd-networkd to configure resolv.conf using DHCP DNS but it looks like I HAD TO START systemd-resolved AND LINK &#x2F;run&#x2F;systemd&#x2F;stub-resolv.conf to &#x2F;etc&#x2F;resolv.conf in order to achieve that (correct me if there&#x27;s a way to not use resolved completely). Excuse me?<p>systemd-networkd itself was buggy, too. I once encountered <a href="https:&#x2F;&#x2F;github.com&#x2F;systemd&#x2F;systemd&#x2F;issues&#x2F;18108" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;systemd&#x2F;systemd&#x2F;issues&#x2F;18108</a> and my friends reported they faced this issue as well. I don&#x27;t mean that software should not have bugs but encounter them is really inconvenient.<p>In conclusion, I mean, systemd components seem to fit together and help you do a lot of things, but they did&#x27;t do the things well, compared to separate programs for their specified tasks. Moreover, you have to deal with various components of systemd and figure out their relationships in order to achieve some specified tasks. For split DNS, I&#x27;m using dnsmasq now and it&#x27;s working pretty well.
tlamponiabout 4 years ago
The declarative format of systemd unit files is just much easier to maintain, grasp and allows doing things that just cannot be done else, for example, a generic way to parallel starting service at boot, as all dependencies and before&#x2F;after ordering is known.<p>And the great things is, that declarative format means that systemd can actually be replaced by something else, as one just needs to be able to parse the ini-style configs and execute the ExecStart and ExecPreStart in order.<p>One really cannot do that to the other init-systems, AFAICT, they are far too scripted and rely a lot on side effects to do anything like that, besides packager choosing different solutions for the same problem. Some KI-paper could possibly take a shot at parsing out some sensible information reusable for another tool ;-)<p>I can get the dissentient about systemd incorporating so much stuff, but just from POV of it as init-system it is really nicer to work with, speaking as user and as someone which job includes packaging software for a Debian based distro.
评论 #27180313 未加载
theteapotabout 4 years ago
<p><pre><code> Cool .---------. .---------. | SystemD |------&gt;| Service | &#x27;---------&#x27; &#x27;---------&#x27; Not Cool .---------. .---------. | SystemD |&lt;------| Service | &#x27;---------&#x27; &#x27;---------&#x27;</code></pre>
评论 #27177954 未加载
exabrialabout 4 years ago
Things that are terrible: logging. Why did we have to screw this up? Just writing stuff to a file was fine.<p>Things that are good: simple syntax, easy to use utils<p>Hidden gems: cgroups, file systems containment, etc. Systemd could completely eliminate the need for stuff like docker by totally isolating a process.
评论 #27176535 未加载
评论 #27176890 未加载
评论 #27176916 未加载
评论 #27176508 未加载
评论 #27176453 未加载
评论 #27178702 未加载
评论 #27176419 未加载
dijitabout 4 years ago
Copying my reply from Lobste.rs because there’s more people here who can pick me apart:<p>_FD: I’m not a large supporter of SystemD after using it when it was first introduced in Fedora and watching it take over the ecosystem, I do use it and as a sysadmin&#x2F;SRE type I’m heavily versed in it and how it functions, so, everything with a pinch of salt._<p>I gave the video a good shot, half the time is spent going over some systemd-ecosystem basics;<p>The author then makes the case that Alpine is a less attractive development&#x2F;production-deployment platform due to lack of this ecosystem (though they make effort to avoid directly saying that systemd would be a good solution itself.)<p>I couldn’t disagree more honestly. I love the concept of Alpine: as small as possible and no smaller.<p>The attention to minimise dependencies makes it the distro of choice in containers; I’ve even considered (strongly) running it on some machines where systemd would have been a lot of needless complexity.<p>I think deviating from this path for alpine is a grave error, there will always be a place for a niche system that is small; especially when it’s commonly paired with some other log managment&#x2F;service orchestrator like Alpine is.<p>Additionally, it gives people like me an option to run without init systems that could be considered heavy and intrusive with heavy dependency chains.<p>So, kindly, Alpine: please don’t.
Decabytesabout 4 years ago
I just learned about Vtubers this week. I would have never thought this would have crossed into the Linux world but here we are!
cervedabout 4 years ago
I can&#x27;t weigh in on the pros&#x2F;cons of systemd because that&#x27;s out of my depth. But I am somewhat fascinated by the hate it seems to endure. Like this<p><a href="https:&#x2F;&#x2F;suckless.org&#x2F;sucks&#x2F;systemd&#x2F;" rel="nofollow">https:&#x2F;&#x2F;suckless.org&#x2F;sucks&#x2F;systemd&#x2F;</a><p>I guess it&#x27;s a bit of a watershed
评论 #27176995 未加载
iso1210about 4 years ago
&gt; So, pretend that this somewhat realistic scenario is happening to you: it&#x27;s 4:00 am you just got a panicked call from someone at your company that the website is down. You log into a server and you want to see if the website is actually down or if it&#x27;s just dns. You probably want to know the answers to these basic questions<p>Those questions the page raises are based on what systemd tells you, not what I&#x27;d be askiny myself. I wouldn&#x27;t want to know most of those, nor do they actually answer if &quot;DNS is down&quot; or not (what does it even mean).<p>From my computer: dig www.mysite.com -- checks DNS is available externally. Check it at a few sites (dig www.mysite.com @1.1, @8.8.8.8, @9.9.9.9 etc). My monitoring checks my website every 10 minutes anyway from multiple locations across the world and tells me if something is wrong, so it won&#x27;t be that.<p>If I think the problem is that DNS lookups are failing on the server (so it can&#x27;t see db1.mysite.com or whatever), something I might suspect if it takes a couple of seconds to log in as the reverse dns times out, I&#x27;d just log in and type<p><pre><code> $ dig www.google.com -- checks DNS lookups are working internally </code></pre> If it&#x27;s not working, I&#x27;d check what&#x27;s configured<p><pre><code> $ cat &#x2F;etc&#x2F;resolv.conf </code></pre> But oh dear, systemd has put its ugly fingers into DNS, and resolv.conf is pointing to 127.0.0.53, so I have to remember some convoluted command to run to try to find out what DNS it&#x27;s using.<p>The easiest way in a systemd world to do that is<p><pre><code> $ tcpdump -i any udp port 53 -nn </code></pre> One of the many reasons systemd is so broken.<p>In systemd that&#x27;s no longer the case, another daemon is running on my machine, another daemon to go wrong, another daemon to hide what&#x27;s actually happening, another daemon to wake me up at 4am because it&#x27;s not working.<p>I type systemd-resolve --status<p>and get 82 lines of nonsense (on my desktop), with perhaps 1 line perhaps telling my the &#x27;current&#x27; server configured, and a few lines telling me other servers. But then there&#x27;s different servers on different links, so it&#x27;s all a bit of a guess, hence tcpdump is far more reliable to see where lookups are <i>actually</i> going.<p>I have a small monitoring PC which runs a bunch of VLC sessions and webpages. It broke a couple of months ago because of systemd hijacking DNS. That means spending time looking in to why it&#x27;s broken, which is a waste of time, or just having a script to fix it on bootup. The script is an ugly hack, but systemd is draining. It gets in my way, I never asked for it, but practically every distro forces its use in various (and constantly changing) ways. That&#x27;s why some people get pissed off by it, it doesn&#x27;t just add features you can use, it fundamentally changes the core of your machine without even buying you dinner first.
cyberpunkabout 4 years ago
I really miss SMF :(
fghorowabout 4 years ago
&quot;This page intentionally left blank.&quot;<p>(Yeah, I&#x27;m a dinosaur who remembers dead tree IBM manuals. Sue me.)
efiechoabout 4 years ago
Poetteringware seems to be highly praised by mostly young people who would like Linux to be a Windows clone. People who understands Unix concepts tends to dislike it.
评论 #27178735 未加载
评论 #27176987 未加载
评论 #27177000 未加载
arid_edenabout 4 years ago
The post was on &#x27;the good parts&#x27; of systemd, so complaining about balance seems unfair. I will call out one aspect that the author deemed a &#x27;good part&#x27; as in my experience its a bad part: journald.<p>Usability: journald requires administrators to learn a new command to access their journals - everytime I have to use it I need to look up the syntax again. Compare with logs in &#x2F;var&#x2F;log and you can use all the standard unix tooling (text editors, tail, grep etc).<p>Reliability: in my use journald has made my servers more unreliable. Two CentOS 7 VMs, setup at the same time. On one journald works just fine, on the other approximately once a month journald would stop logging. It wouldn&#x27;t start logging again until you noticed and rebooted the server. The real issue this exposes is that on a systemd machine, journald doesn&#x27;t just log for itself, it also supplies the logs to syslog. So on this server when journald broke, there were <i>no logs whatsoever</i>.<p>This issue was apparently common on the version of systemd shipped with CentOS 7. The fix was to disable log compression in journald. What it highlighted to me was the inherent issues in an all encompassing system controller like systemd, in that if there is a bug somewhere in there you lose not only the added bells-and-whistles its intended to provide (journald in this case) but also the old previously reliable functionality (syslog).<p>In my mind the fix for this is a redesign of systemd to make it an optional layer on top of the reliable functionality rather than a low level system component that everything else needs to depend on. In the case of logs journald should consume logs from syslog, not provide them to syslog.
评论 #27181191 未加载
ratsmackabout 4 years ago
&gt;systemd is a set of building blocks that you can use to make a linux system.<p>A more accurate description would be &quot;Systemd is a set of building blocks that you can use to make Linux more like Windows&quot;.
评论 #27179444 未加载
评论 #27176209 未加载