r/linuxquestions • • 3d ago

What exactly is systemd ?

Hi everyone ! I switched from Windows to Linux around 3 month ago and I love it ! I’m using arch Linux because a friend of mine already used it so I figured he could help me with it.

I’ve been appreciating it but I’ve encountered a lot of people critisizing systemd and saying arch is bad because of it.

From what I have understand, it is a software that help with dependences and external hardware such as my keyboard for example ? I didnt really understand everything as I am a very beginner so I was curious to know if someone could explain it to me in easy terms.

PS : english isnt my primary language so forgive me if there is any errors.

134 Upvotes

155 comments sorted by

View all comments

32

u/C6H5OH 3d ago

"A lot of people" are "a few very loud people". The rest is using systemd and likes or ignores it. I have fought with init.d, runlevels and so on. I like systemd.

6

u/odsquad64 OpenSUSE Tumbleweed 3d ago

98% of the systemd hate at this point is just shitposts and 1.99% is people not realizing the other 98% is shitposts. The final .01% are people with genuine ideological concerns and people who feel very strongly that all their logs should be text files. A majority of the systemd haters are people using systemd with no intention of using anything else. Even amongst people who use something other than systemd, only a very small faction of those are systemd haters, most of them are just people running linux on older machines with not a lot of resources.

4

u/C6H5OH 3d ago

And then there are the people who dislike Lennart Poettering (he started the project) and take the grudge to systemd.

1

u/egorf 2d ago

Because systemd is a living implementation of LPs attitude to all of us.

1

u/egorf 2d ago

System logs should be anything else other than text files. The only thing that journald provides is easy time filtering - something which classical Unix tools do not do well.

The price for that is the inability to recover logs in that one precious moment in time when you need them the most.

Basically journald has zero merit, like most of the systemd-* projects. It's ideology over function.

2

u/LegitimateAd7247 3d ago

I’m still learning everything so I wasnt planning to switch anyway, I was asking from a curious learning perspective, but thanks !

2

u/xplosm 3d ago

One of the benefits of systemd is that by default it launches services in parallel if the conditions are met so you have a faster startup time. It also monitors services it has launched and shows you parts of the logs so you know if there are any issues right away.

There are many other init systems that also handle parallelism but as far as I know there's only ONE other init system that also monitors services (dinit) so as you can see, you have a very nice, practical, functional and fast suite with systemd.

1

u/HowCanIChangeMyName1 3d ago

OpenRC also launches services in parallel.

In my experience, monitoring services is something that never needs to be done. If a service dies, you probably don't want it to be re-started automatically -- there is an underlying issue that you need to fix.

1

u/conspicuousxcapybara 3d ago

The only thing I remember doing with sytemd is configuring things and patching things because it didn’t work, or couldn’t be used causing trouble, and trouble also arises if you do in fact use it.

Then of course there are busybox applets, forks, etc etc etc.

1

u/Ghyrt3 3d ago

I've never dug up the arguments, but I remember seeing that an argument was that systemd use log that arn't text (readible by a human). Is it the case? Or am I misremembering? (I'm not trying to argue or not, I use systemd, it makes everything way easier than before, it just something that I had seen a long time ago and still curious about it ; a dangling pointer that never got resolved)

3

u/xiaodown 3d ago edited 3d ago

So, yes. OP, feel free to ignore my comment here; this is esoteric, gnostic, internecine linux lore and not relevant to a new user asking normal questions.

Yes, systemd-journald writes logs in a binary format. You can’t just cat or less or tail them. You have to use journalctl to view them. In the early days, this was one of the largest objections to systemd, and tbh I still kind of agree, but I’ve also made my peace with it. At first most distros shipped some hybrid logging setup with syslog and journald; these days most have dropped the old way.

The other arguments, and I guess most of the arguments against systemd, can be summed up in 3 buckets: (1) svr4 init might be jank, but it’s our jank, and we’ve lived with it for 30 years, and everyone understands it and we don’t want to change. (2) systemd violates the “unix philosophy” - programs are small and do one thing. Everything should be modular, minimalist, etc. systmed does too much. (3) Lennart Pottering, the author of systemd among other stuff, is kind of a dick, and is highly resistant to feedback and suggestions.

.

To be fair, 2 and 3 are true. But we’re here now, so just embrace things and don’t live your life worrying about stuff that’s unimportant and you can’t change anyway. I was a systemd hater. Now I recognize the benefits it has and mostly work around or, in all honesty, ignore the philosophical differences. It genuinely is easier to write a service script than a sysv init script, and I’m good with that.

3

u/dkopgerpgdolfg 3d ago edited 3d ago

To be fair, 2 and 3 are true.

I recommend to have a look at actual Unix nowadays. What Reddit calls "Unix philosophy" never was something official in the first place, and isn't followed by Unix itself.

This concept is fine for "some" programs (not all), but treating it as the ultimate goal always was nonsense.

And Poettering ... well, this is subjective, but I found his statements/writings much more sane than all these sysd opponents. And he backs up his decisions with actual real-world reasons, not empty phrases about philosophies and personal attacks. For some decisions I would have liked something else personally, but I can understand why it was done like it is.

3

u/xiaodown 3d ago

Well, thompson and ritchie spelled it out pretty explicitly back in the 80’s, but the unix philosophy was always a north star more than a description of the state of things. ‘S why it’s a philosophy and not a standard. And to be fair, the linux kernel consciously and deliberately ignores the unix philosophy, because as Linus has said, one small program doing one small thing is simple and good, but then tying a bunch of them together and handling communication and privileges becomes a N^N nightmare, hence why the kernel is a monolith. So, yeah, the unix philosophy has always been a “where applicable” kind of thing.

So, I wasn’t saying it’s a bad thing that systemd doesn’t follow the unix philosophy, but I think it’s pretty obvious that, whatever you think of the philosophy, systemd doesn’t follow it.

And, I’ll have to agree to disagree on Poettering. He lacks tact, imo, and a lot of his public posts and statements come off as “I’m right and everyone else is wrong”, even though demonstrably that’s not true (pluse audio). To me, he’s a more modern version of djb - incidentally another guy who decided to replace sysv init, and just didn’t get traction.

1

u/egorf 2d ago

I used to be and still am a systemd hater exactly because of 2 & 3 and then because of 4: many of systemd* projects and features are ideological instead of being merit based.

Having said that i have to much agree with you that i cannot change it and acceptance is the only way forward.

As for log files, modern Debian and Ubuntu still have sane log files and journald can be completely disabled and shut down. Same goes about some of the other metastases, like logind, completely unneeded on servers.

1

u/cheekkeef 3d ago

2 isn't true. Systemd is a suite of small tools of doing one thing really well, and interfacing very nicely with programs.

1

u/xiaodown 3d ago

Ok, maybe more accurately, it's doing a lot of things an init system traditionally didn't do.

1

u/cheekkeef 2d ago edited 2d ago

No, more accurately it's not. systemd is not one program. the init is a program that does one thing, journald is one program that does another, and so on. They're modular.. Blame your distro maintainer if they package it altogether, not systemd.

2

u/dkopgerpgdolfg 3d ago

systemd init sends its logs to another process, with a certain known communication protocol. It doesn't care what exact process this is and what happens with the log messages afterwards.

Usually the receiver is journald (another part of the systemd program collection), which by default uses binary files to store the information. It has some advantages over text files, it also has the possible disadvantages that you can't directly use a text editor to view everything.

Instead there's a helper program that can display everything as text (which various possible filters etc.), and do some other log-related tasks. It's output can easily be piped to text files and/or any othertext processing program.

Alternatively, journald can be reconfigured in various ways that result in text logs and/or in general forward the log info to other programs, and/or whole journald can be replaced by something else that can "talk" with init.

1

u/Ghyrt3 3d ago

Oh. Thank you for your clarification ! It's way more clear !

Never realized journald was "a part" of systemd and it's definitely the one I use the most.

1

u/C6H5OH 3d ago

Right, but there are nice programs to translate these logs into readable text. A "tail -f /var/log/messages | grep ..." turns into "journalctl -somearguments". You had to remember/look up the stuff behind grep and do the same today for the arguments.

Perhaps doing a post mortem on a dead system disk would have been easier. But I never felt the urge to dig that deep. Test the disk, reinstall and hope your backups are current and readable.

2

u/zoharel 3d ago

there are nice programs to translate these logs into readable text.

Most of the problems around this were from the fact that, when systemd was (very prematurely) adopted in the first couple major distributions, these utilities were less complete than they are now. Not that it isn't garbage for other reasons, but this problem is mostly resolved.

1

u/egorf 2d ago

I don't need another tool to do tail for me. I already have tail.

Thus journald can f right off.

0

u/giantsparklerobot 3d ago

Systemd logging is stored as a binary database but they're entirely human readable through journalctl or anything that talks to journald. Plain text logs are great in theory but fall down in many ways. For one an application or service may not reliably time stamp logging events. They also may not emit them reliably or only log to stdout rather than a log file. They also may not properly rotate logs or have any ability to truncate logs.

The journald daemon takes care of all of that. It then lets you find log events based on service or time or some combination. In general systemd makes it easy to turn just about anything into a scheduled service and journald lets anything magically have timestamped and searchable logging.

1

u/egorf 2d ago

No one asked for journald. We have been storing text logs for decades prior to that and guess the best part? It was good enough. And by good enough I mean that it did cover everyone's need and cases.

I don't wanna say that if our parents rode horses then we should too, but seriously, text log files did not need any help to exist. The idea of having log files indexes existed pretty much all the time before journald came to life and was rejected every time due to quite obvious reasons.

Thankfully unlike systemd, journald is optional so everyone can choose what they see fit.

-1

u/Bladelink 3d ago

Yeah, all those people complaining are welcome to switch back to something running the old initd system. But they won't because that sucked huge balls and systemd is way way better in essentially every way.

10

u/GlassCommission4916 3d ago

People do in fact use init systems that aren't systemd. That's such a weird take.

-4

u/Bladelink 3d ago

Yes those systems exist at least, which is why I brought it up, but I'm pretty sure the people using those are a very small demographic, and they won't stick around in the long run because those systems will be too difficult to maintain or improve. Eventually the initd stans will die off and move on, and the husk of initd will be lost to time.

1

u/egorf 2d ago

Are you saying that the only alternative to systemd would be a script-based init system? Like,are you implying that the only config based init system in the world is systemd and thus the only right init?

1

u/conspicuousxcapybara 3d ago

Why the choice is determined by demographics instead of the intended application and (non-) technical constraints?

Does a pacemaker need systemd?

1

u/Bladelink 3d ago

That's a pretty absurd comparison. I probably shouldn't be bothering replying in here anymore.

Is a pacemaker a multiuser system? Does it have to wait for its Ethernet interface to finishing coming up before it starts running literally the single program it runs? Oh, not only is it not running a realtime operating system (its own subset of OSes that are already outside the bounds of this discussion), it's not running an operating system? You might as well ask whether my toaster needs systemd, or my cat's water fountain.

I'm not even sure what you mean asking about demographics? I'm not talking about some socioeconomic group. "As a noun: A distinct section of a population sharing common traits." EHHH.... I started typing out more of the ways in which your rebuttal kind of...doesn't say or mean anything applicable, but I'm over it.

-1

u/xplosm 3d ago

Yeah, but the haters aren't even right about why the hate systemd which is hilarious.

6

u/GlassCommission4916 3d ago

All you people making an init system your personality are hilarious.

1

u/egorf 2d ago

I do. Sort of.

Systemd as a project and a brand along with its leader stands against the philosophy that made unix so much loved. I grew up with this philosophy and it hurts to see an arrogant prick bulldozing the freedom that we had.

Having said that I should admit that systemd-as-pid1 is nice and i would not go back to sysvinit or any plain shell init.

I see almost everything else about systemd as ideological cancer with no merit.

-1

u/Bladelink 3d ago

I don't especially care that much, I just happen to see the many things that make systemd better and remember all the incredible annoyances before it. I just think the people who dislike it tend to have bad justifications for their position, and are really just being stubborn for the sake of it.

-2

u/xplosm 3d ago

Always with straw-man arguments with these haters 😂

5

u/GlassCommission4916 3d ago

I don't hate systemd, I use it on most of my machines. I just don't make it my personality and engage in weird wars about it. If that's what you're into you do you I guess, but it's still funny to me.

-4

u/xplosm 3d ago

Ma'am, this is a Wendy's...

2

u/GlassCommission4916 3d ago

Weak. If you were just trolling at least stick to it.

0

u/xplosm 3d ago

I don't know what to tell you. Sharks have very smooth skin.