SystemD is blamed for long boot times and being heavy and bloated on resources. I tried OpenRC and Runit on real hardware (Ryzen 5000-series laptop) for week each and saw only 1 second faster boot time.
I’m old enough to remember plymouth.service (graphical image) being the most slowest service on boot in Ubuntu 16.04 and 18.04. But I don’t see that as an issue anymore. I don’t have a graphical systemD boot on my Arch but I installed Fedora Sericea and it actually boots faster than my Arch despite the plymouth (or whatever they call it nowadays).
My 2 questions:
- Is the current SystemD rant derived from years ago (while they’ve improved a lot)?
- Should Linux community rant about bigger problems such as Wayland related things not ready for current needs of normies?
Ok, so I have a very unique background in systemd. I worked at Red Hat supporting it basically as the primary support and I’ve worked with the developers of systemd at Red Hat directly. I no longer work there.
So first off, it’s “systemd” all lower case. I don’t care, but for some reason Lennart Pottering (creator) does.
systemd was a MASSIVE change. And Red Hat did a TERRIBLE job relaying it. To the point where I’m still trying to get my company to understand that it can NOT be treated like the old init systems. You can NOT just drop an init script in place and walk away and hope it works. Because a LOT of times it doesn’t. Due to forks, switch users, etc.
systemd is NOT an init system. RHEL 5 and older had sysvinit as it’s init systemd. RHEL 6 had UpStart as it’s init system and looked exactly like sysvinit that no one even noticed. systemd again is NOT an init system. Init system is 1 part of systemd. systemd does a lot of cool things. It bundles applications together, it manages those applications and can restart them or kill children, it can do resource constraints, it separates out users from the system, and lots more.
Because it is not an init system there is a LOT LOT LOT of bad recommendations out on the internet where someone has X problem and person suggests Y and IT WORKS! … except it doesn’t REALLY work as far as systemd is concerned and you’ll hit other issues or your application takes longer to start or stop and people just blame systemd.
It is systemd’s fault that it has done an ATROCIOUS job of helping people adapt. It’s a great example of RTFM. systemd’s man pages are INCREDIBLE and extensive, but when you drop so much knowledge it becomes more difficult to find what you want/need. systemd.index and systemd.directives are your best bet.
So systemd does a lot of amazing things that sysvinit never attempted to do. It’s never attempted to explain anything it expects everyone just learn magically. it’s INCREDIBLY complex, but once you understand it’s basics you can more easily get an application running, but as soon as there’s a problem it’ll just break your brain.
To give you an example, sshd’s old init script is like 250 lines of bash. systemd’s unit file comparative is like 12. Because systemd handles a LOT of what you manually had to handle before. BUT to get to that 12 you literally have to learn EVERYTHING new.
There is no “is it good or bad” here really imo. It’s a completely different fundamental design. Red Hat made it for themselves. Other distros picked it up. It can be argued that lots of folks followed Debian and Debian had a few Red Hat board members that were pushing it. Whether they pushed it of their own accord or because they were with Red Hat I don’t have a clue.
What I can say is at my current company they’re suffering from a LOT of systemd issues and they don’t even realize it. I’ve been working with Red Hat to try to get Insights to alert people to the failures and we’re making progress.
To see if you have issues just to start run the two following commands:
# systemctl list-units --failed # systemd-cgls
If you have any units that are failed, investigate those. If you don’t need them, disable them. As for the systemd-cgls this shows HOW systemd is grouping things. ANY application that runs as a service (or daemon or application or runs in the background or however you wanna say it) should be under system.slice. ONLY humans logging into the system (meat bags NOT applications switching to users) should be in user.slice. A LOT of times what happens is an old init script is dropped in place, they start it, it has a switch user and systemd assumes it’s a user and puts it into user.slice. systemd does NOT treat anything in user.slice the same as in system.slice and this WILL eventually cause problems.
So again, is it good or bad? Eh. It does a lot of cool things, but they did a MASSIVE disservice to ALL of us by just expecting to relearn absolutely EVERYTHING.
sshd’s init script under OpenRC is 87 lines, of which around half are blanks, comments, closing braces, and other boilerplate. Granted, that still makes the real code maybe three times the size of your systemd unit file, but the difference isn’t as impressive as you’re making out.
95% of people shouldn’t need to poke around in their init scripts or unit files anyway. If you actually need to do that, your use case is already somewhat unusual.
As an end user, unless you’re running a server, then no you shouldn’t have to mess with any of it.
If you’re running a server or a sysadmin you absolutely 100% should be paying attention. Almost every single vendor I’ve seen selling their applications only have initscripts. Which then cause issues. I’ve gone to the vendors and told them and they’ve said go to Red Hat. Well Red Hat doesn’t support that vendor’s init scripts.
Not naming an application, but it was from a BIG BLUE company and they said their only instructions are to call their script from the user. But it won’t remain running if you do that because systemd will close out the slice when the user logs out. SO it’s obvious they haven’t tried what they’re suggesting.
And I’m not attempting to state that systemd is impressive in any way. systemd basically took what had been building over 40 years of init scripting and threw it out the window and said our way is better. I don’t think it is. I’m just saying, with a directive based unit file it’ll be simpler to parse than a bash script.
Nah, it’s fine. Boot times are considerably faster than sys.v in most cases, and it has a huge amount of functionality. Most people I work with have adopted it and much prefer it to the old init.d and sys.v systems.
People’s problem with systemd (and there are fewer people strongly against it than before) seem to break down into two groups:
-
They were happy with sys.v and didn’t like change. Some were unhappy with how distros adopted it. (The debian wars in particular were really quite vicious)
-
It does too much. systemd is modular, but even so does break one of the core linux tenets - “do one thing well”. Despite the modularity, it’s easy to see it as monolithic.
But regardless of feelings, systemd has achieved what it set out to do and is the defacto choice for the vast majority of distros, and they adopted it because it’s better. Nobody really cares if a user tries to make a point by not using it any more, they’re just isolating themselves. The battle was fought and systemd won it.
One of my biggest problems with critics of systemd is that a lot of the same people who make that second point also argue against wayland adoption when xorg does the exact same thing as systemd. It makes me feel like they’re just grumpy stubborn old Linux nerds from the 90s who just hate anything that’s not what they learned Linux with.
Which is sad, because honestly I think it’s kind of not great that an unnecessarily massive project has gained such an overwhelming share of users when the vast majority of those users don’t need or use most of what it does. Yeah, the init systems from before systemd sucked, but modern alternatives like runit or openrc work really well. Unfortunately they get poorly supported because everyone just assumes you have systemd. I don’t like the lack of diversity. I think it’s a problem that any init system “won”.
Unfortunately they get poorly supported because everyone just assumes you have systemd.
No, they get poorly supported because they were a pain to support even before systemd ever showed up. I for one was extremely tired of writing the same shit over and over again in every init script and then going through the tedious process of porting the script to every platform for minor idiosyncrasies of the various distros (start-stop-daemon available or not was one I remember, the general bash/GNU vs. BSD stuff you get with any script was another) from 10 year old RHEL to modern ones.
Xorg, or X11, “used to” do the “minimum necessary” for a remote display system… in the 80s. Graphics tech has changed A LOT in the last 40 years, with most of the stuff getting offloaded to GPUs, so the whole X11 protocol became more and more bloated as it kept getting new and optional features without dropping backwards compatibility.
The point against Wayland, was dropping support for remote displays, while kind of having an existential crysis for several years during which it didn’t know what it wanted to become. Hopefully that’s clear now.
OpenRC and runit are indeed working alternatives, but OpenRC is kind of a hack over init.rd, while runit relies a bit too much on storing all its status in the filesystem. Systemd has a cleaner approach and a more flexible service configuration.
Maybe
systemd
gets grouped withwayland
andxorg
with other init systems simply because of usability?I mean, I got used to the thought that what I prefer is less usable, because some pretentious UX designers say so, and we Unix nerds use inconvenient things because we are all perverts.
But when I read about industrial design and ergonomics, it seems that my preferences are consistent with what I read, and all those UX designers and managers should just be fired for incompetence and malice.
Back to wayland/xorg and runit/systemd (for example), same reason FreeBSD may seem easier to set up and use than an “advanced” Linux distribution - there’s less confusion.
“do one thing well”
Arguably, Systemd does exactly that: orchestrate the parallel starting of services, and do it well.
The problem with init.d and sys.v is they were not designed for multi-core systems where multiple services can start at once, and had no concept of which service depended on which, other than a lineal “this before that”. Over the years, they got extended with very dirty hacks and tons of support functions that were not consistent between distributions, and still barely functional.
Systemd cleaned all of that up, added parallel starting taking into account service dependencies, which meant adding an enhanced journaling system to pull status responses from multiple services at once, same for pulling device updates, and security and isolation configs.
It’s really the minimum that can be done (well) for a parallel start system.
systemd is modular, but even so does break one of the core linux tenets - “do one thing well”.
Linux itself (i.e. the kernel) breaks the hell out of that so-called core tenet. Have you looked at
make menuconfig
at any point? There’s everything but the kitchen sink in there.Apples to oranges, and you can have a minimal kernel tailored to your needs.
I just hate the syntax, systemctl start apache2 feels like dumb manager speak over service apache2 start.
But other then that I love how systemd has been for me.
How so? I like the systemctl syntax more, since it allows for starting/stopping many units at once. It also supports a much richer set of commands than service ever did.
it just feels like a manager decided the command should read like english, made the decision then went back to never entering a command again in the terminal again. every day, i get to decide, should i enter “systemctl restart problem_service” all again or hit up on the keyboard and and hold back, then rewrite over the previous status command. bit less work if the status/stop/start/restart bit was on the end like it used to be.
In BASH ALT+T will swap the last white spaced separated strings… It’s still annoying but makes “systemctl problem_server start/status/restart” a bit easier. CTRL+W will clear the current string to whitespace, so up arrow, ALT+T, CTRL+W, status, ALT+T, Enter.
The bit was on the end because it was an argument to the script specific to that program. Instead, the control is now at the start because it is an argument to systemctl itself. This removes the ability to define custom controls, but enables you to control many things at once.
Yeah,
command subcommand args...
. Theservice
format makes more sense when you’re seeing it as “run this script to control this service”. Thesystemctl
format makes more sense as a frontend subcommand to control systemd itself.
-
SystemD is blamed for long boot times
That is and always was nonsense. Systemd shortens boot times by starting things in parallel. That’s one of its key features.
There are some things to note about that:
Systemd only starts services in parallel when it isn’t told otherwise by
Before
and/orAfter
settings in the service files. This makes it pretty easy to make systemd slow by misconfiguring it. You can use thesystemd-analyze
program to see which services held up your boot.Systemd has a very long default timeout (90 seconds) for starting or stopping a service. It’s appropriate for the big, lumbering servers that systemd was probably designed for, but it might be wise to shorten the timeout on desktops, where a service taking more than 5 seconds to start is almost certainly broken. It’s a setting in
/etc/systemd/system.conf
.Is the current SystemD rant derived from years ago (while they’ve improved a lot)?
I’m an early adopter of systemd. I installed it on my Debian desktops pretty much as soon as it was available in Debian, and I later started moving servers to it as well. I had long been jealous of Windows NT’s service manager, and systemd is exactly what I had hoped would come to Linux one day.
Yes, the rant you’re talking about is old, and yes, systemd is better now than it was then, but not in the sense of what the rant was complaining about. The rant was already patent nonsense when it was written, which has given me a very dim view of the anti-systemd crowd.
Besides systemd proper, they also spent a lot of time ranting about the journal system, which redirects syslog entries into a set of binary log files. They complained that this would make logs impossible to read in emergencies. This isn’t even close to being true—any emergency bootable Linux image worth its salt has a copy of
journalctl
on it—and the binary nature of systemd’s logs has caused me serious problems on exactly zero occasions.We’d probably need to qualify this with “bad compared to what”. I can’t complain, as it does its job, and I’ve been able to tweak what I needed to. As I don’t tinker with it every week, I keep a sticky note rolled up on my desktop, or I quickly use ‘cheat systemd’ to remember some key examples.
I was getting really long start up time earlier this year (like 19 mins before the desktop was fully responding) and after trying everything else I tried ditching BTRFS and reverting my /home drive back to ext4. Turns out BTRFS start and checks was killing my boot times. Now, as fast as anything.
The following have been my saviours though in identifying boot times: journalctl -b -p err systemd-analyze blame --user systemd-analyze blame
I do not think systemd is bad, I (and personal preference here) much prefer it over the older style of init systems.
Quite frankly, one of the things that has always irked me about a portion of the Linux community is that as far as I know, a strength and selling point of Linux has always been the freedom of choice. And yet, people start wars over your choices. For example, I know at least on r/Linux if you were to make a post saying that you liked Snaps over Flatpaks you’d get torn to shreds over it. Wouldn’t matter what reasons you had either.
It is always something. Whether its about Arch vs other distros, Snaps vs Flatpak vs AppImage vs Traditional packaging, X11 vs Wayland, systemd vs Sys V/init.d, pulseaudio vs pipewire, etc.
I never understood why it mattered so much what someone ran on their own computer. Assuming they’re the only one using it, what is the big deal if they choose to run OpenRC, X11, Snaps, and Alsa?
And I get a bad feeling the next one is going to be immutable distros vs non-immutable distros, but I guess we’ll see.
Quite frankly, one of the things that has always irked me about a portion of the Linux community is that as far as I know, a strength and selling point of Linux has always been the freedom of choice. And yet, people start wars over your choices
the “war” about systemd was actually a discussion about the (continuing) ability to make choices, not that some people chose systemd over other options. One of the main points of the debate was that systemd was monopolizing the init process and turning gnu/linux into gnu/linux/systemd.
The assertion that people were just upset like little babies that some wanted to choose a different init is highly disingenuous.
And yet it’s the only argument you’ll hear. I don’t know what possesses some people to act like critcism of systemd makes you an entitled manchild, I suspect they might be imbeciles.
I am fine with it and personally make heavy use of it. On my Arch install, I use systemd-boot, systemd-timesyncd, neworkd, resolved and unified kernel images with ukify.
Roast me you systemd haters.
Just try to implement user session management on a non systemd distro…
Systemd is way better than others init system. I’m using Alpine Linux on my phone and I really wait for a Fedora/Arch like PMOS project (it’s on the way)
[
]Just saying, not everyone needs session management…
sudo su
Why spawn additional process when you can get into shell directly with
sudo -s
?What do you do with all the process you save with that trick ?
Well, sudo itself is a purely optional component—you can run a system quite happily with just su .
It’s a massive question, and I think quite a lot of the argument comes from the fact that it depends what direction you’re answering it from.
As a user, do I like being able to just
systemctl enable --now whatever.service
, and have a nice overview of ‘how’s my computer’ insystemctl status
? Yes, that’s a big step up from symlinking run levels and other nonsense, much easier.As an administrator, do I like having services, mounts and timers all managed in one way? Yes, that is very nice - can do more with less, and have to spend less time hunting for where things are configured. Do I think that the configuration files for these are a fucking mess of ‘just keep adding new features in’ and the override system is lunacy? Also yes.
As a developer trying to do post-mortem debugging, who just wants all the logs in front of him for some server that’s gone wrong somehow, which I often have to request via an insane daisy-chain of emails and ‘Salesforce nonsense that our tech support use’ from our often fairly non-technical end users, on some server that I’ve no other access to? No, I do not find having logs spread between
/var/log
and journalctl (and various CloudFormation logs in a web console) makes my life easier. I would be pleased if that got sorted out.tl:dr; mostly an improvement, some caveats.
I am for most part quite happy with it. For all the complexity it brings, it also allows you to do a lot of stuff easily and reliable that would have been a nightmare with previous systems.
My biggest nitpick is that some commands are needlessly obtuse, e.g. trying to find an error message in
journalctl
is a mess when you aren’t already deeply familiar with the tool. It will show you messages that are months old by default, will give exactly the same output for typos in the unit name as it will for no error messages and other little things like that.- Is the current SystemD rant derived from years ago (while they’ve improved a lot)?
No it’s almost always been derived from people’s behinds.
- Should Linux community rant about bigger problems such as Wayland related things not ready for current needs of normies?
Yes.
Systemd is spectacular in many ways. Every modern OS has a process management system that can handle dependencies, schedule, manage restarts via policy and a lot more. Systemd is pretty sophisticated on that front. I’ve been able to get it to manage countless services in many environments with great success and few lines of code.
Yes. Yes it is. systemd isn’t bad for boot times, but more for tying so many goddamn things to init, PID1, creating just about the best attack point one could ever ask for. Wayland not being ready can be solved by not using it for the time being. Just use X. Also, it’s still called plymouth.
linux is also about choice, so it doesn’t matter if something is bad for you. you can use a different alternative or even make/fork one.
This is the first top-level comment that hints at the main criticism against systemd. systemd is increasingly difficult to replace as time goes on. I like and use systemd because it has a fast boot, but I wish the project was developed in a more modular way that had choice built-in. It is instead developed as the way that everyone should systemd instead of alternatives. This philosophy gets in the way of distributions that want to provide alternatives (Devuan, Gentoo, Parabola, etc.). Some of the sysadmins I work with closely use Devuan and follow development. I hear the patch set around bypassing systemd grows in size and complexity each year which is worrisome for choice.
Keep in mind that it all started 20 years ago with Pulseaudio. Pottering was not really a nice guy (on mailing lists ofc, I don’t know him personally) whose software I wanted on my machine.
Problem was never speed or even technical, problem was trust on original author and single-mindedness that they were promoting. Acting like it is the only way forward, so anyone believing in freedom part of free software was against it. Additionally, it was looking like tactics used by proprietary software companies to diminish competition.
It looked scary to some of us, and it still does, even worse is that other software started having it as hard dependency.
All of this looks like it was pushed from one place: Portering and RedHat.
While after 20 years I might have gotten a bit softer, you can imagine that 15 years ago some agresive and arogant guy who had quite a bad habbit of writing (IMHO) stupid opinions wanted to take over my init system… no, I will not let him, not for technical reasons but for principal.
I want solutions to come from community and nice people, even if they are inferior, I will not have pottering’s code on my machine so no systemd and no pulseaudio for me, thank you, and for me it is an important choice to have.
Keep in mind that it all started 20 years ago with Pulseaudio. Pottering was not really a nice guy (on mailing lists ofc, I don’t know him personally) whose software I wanted on my machine.
Poettering is like Torvalds: gruff when pressed, but not wrong.
PulseAudio is like systemd: dramatically better than what came before, and the subject of a great deal of criticism with no apparent basis in reality.
PulseAudio did expose a lot of ALSA driver bugs early on. That may be the reason for its bad rap. But it’s still quite undeserved.
Additionally, it was looking like tactics used by proprietary software companies to diminish competition.
This is a nonsensical argument. Systemd is FOSS. It can and will be forked if that becomes necessary.
Which, in light of recent changes at Red Hat, seems likely to happen soon…
Problem was never speed or even technical, problem was trust on original author and single-mindedness that they were promoting.
That’s because fragmentation among fundamental components like sound servers and process supervisors results in a compatibility nightmare. You really want to go back to the bad old days when video games had to support four different sound servers and the user had to select one with an environment variable? Good riddance to that.
I want solutions to come from community and nice people
Then you’d best pack your bags and move to something other than Linux, because Linus Torvalds is infamous for his scathing (albeit almost invariably correct) rants.
Poettering is like Torvalds
Lol, not even close. I am not talking about being harsh for writing stupid code. Nor I want to go 20 years back to proove it to some random person, do it yourself.
Systemd is FOSS. It can and will be forked if
Yeah, the same way chrome can be forked. No, software developed like that - in closed room just source being dropped on to community, what happened with PA and SD in the begging no one wants to touch. Gentoo had big problems just maintaing eudev and elogind to enable gnome and some other software to work.
Luckily, it is not important anymore, there is pipewire so I managed to skeep PA completely.
@argv_minus_one @monobot Pulse Audio is good for a desktop multi-program environment. Its optimized for context switching, however for MIDI applications it has too much latency and you need to use Jack.
@thanhdo @argv_minus_one @monobot What about Pipewire? Doesn’t that combine Pulseaudio und Jack capabilities?
PipeWire is a whole other audio manager that happens to be compatible with PulseAudio and JACK.
- systemd hasn’t become a better project built by better, smarter people to deliver a better set of features. It’s still hot garbage.
- it’s okay to continue pointing out it’s hot garbage, in the hopes we can go forward or back or just get on something better/else (same thing).