152
submitted 10 months ago by [email protected] to c/[email protected]

After a few conversations with people on Lemmy and other places it became clear to me that most aren't aware of what it can do and how much more robust it is compared to the usual "jankiness" we're used to.

In this article I highlight less known features and give out a few practice examples on how to leverage Systemd to remove tons of redundant packages and processes.

And yes, Systemd does containers. :)

all 46 comments
sorted by: hot top controversial new old
[-] [email protected] 34 points 10 months ago

One of the big complaints of systemd detractors I read is that it’s “monolithic” and “taking over everything” and this “shouldn’t all be part of init”

You might want to point out that all the features outside of systemd-as-init are optional and can be replaced or ignored if you don’t want them. They also don’t run as PID 1

You do have to use systemd-journald, but you can also just forward it to syslog if you want

[-] [email protected] 8 points 10 months ago

all the features outside of systemd-as-init are optional and can be replaced or ignored if you don’t want them

Yes, but the point of the article was kind of the opposite - simply try all the systemd tools and components and see how much better things can get.

[-] [email protected] 1 points 10 months ago

yeah but the OP's point was not

[-] [email protected] 31 points 10 months ago

Do we have to bring this up again? It's just boring.

systemd is here and it isn't going anywhere soon. It's an improvement over SysV, but the core init system is arguably less well-designed than some of the other options that were on the table 10 years ago when its adoption started. The systemd userspace ecosystem has significantly stifled development of alternatives that provide equivalent functionality, which has led to less experimentation and innovation in those areas. In many cases those systemd add-on services provide less functionality than what they have replaced, but are adopted simply because they are part of the systemd ecosystem. The core unit file format is verbose and somewhat awkward, and the *ctl utilities are messy and sometimes unfriendly.

Like most Red Hat-originated software written in the last 15 years, it valiantly attempts to solve real problems with Linux, and mostly achieves that, but there are enough corner cases and short-sighted design decisions that it ends up being mediocre and somewhat annoying.

Personally I hope that someone comes along and takes the lessons learned and rewrites it, much like Pulseaudio has been replaced by Pipewire. Perhaps if someone decides it needs rewriting in Rust?

[-] [email protected] 10 points 10 months ago

The core unit file format is verbose and somewhat awkward, and the *ctl utilities are messy and sometimes unfriendly.

While I agree with the rest I don't particularly believe in this. The unit format is well structured and solves many pitfalls of previous approaches, it also supports configuring a myriad of different things from mounts to sockets and the network in a nice way.

[-] [email protected] 2 points 10 months ago

I find systemctl to do a much better job than any alternative that comes stock with distros. I’m looking at you service

[-] [email protected] 1 points 10 months ago

I find a unit file much easier to grasp than an init file, I'll tell you that.

[-] [email protected] 6 points 10 months ago

Thanks for summarizing my feelings on systemd in a less inflammatory way than if I had written it myself.

I've found that most distributions have implemented it properly and for the most part it works quite well and stays out of my way, it's only when for some reason you have to dive into the minutiae of a unit file and getting into all the dependencies and stuff that it gets annoying quickly.

[-] [email protected] 4 points 10 months ago* (last edited 10 months ago)

The dependency system takes a bit to understand but compared to like upstart it was a massive improvement.

[-] [email protected] 7 points 10 months ago* (last edited 10 months ago)

Everybody gangsta until A start job is running for ... (10s / 1min 30s)

[-] [email protected] 5 points 10 months ago* (last edited 10 months ago)

Or, even worse, A start job is running for ... (10s / no limit)

[-] [email protected] 1 points 10 months ago

I don't see how exactly that is systemd's fault.

You are blaming it for having proper dependency handling?

[-] [email protected] 2 points 10 months ago

I'm blaming it for making it a pain in the ass to debug dependency problems and for having the confusing, non-intuitive, overly verbose and redundant syntax that probably caused the problem in the first place.

Like, who the hell can memorize all the subtle differences in behavior between After=, Requires=, Wants=, Requisite=, BindsTo=, PartOf=, UpHolds= and then all their "reverse" equivalents?

[-] [email protected] 1 points 10 months ago

lol, that brought back memories

[-] [email protected] 1 points 10 months ago

I installed OpenBSD and never looked back. This isn’t an option for everyone but I encourage those who have these kinds of feelings to have a look.

[-] [email protected] 24 points 10 months ago

systemd brings much functionality. It can't follow unix philosophy because unix is 50 years old. the whole community drama about this systemd VS sysV VS OpenRC VS whatever comes up, is funny. There are distros that are systemd-free if you wish so much to avoid it.

[-] [email protected] -1 points 10 months ago

There are shrinking in numbers, especially for mainstream distros, tho...

[-] [email protected] 15 points 10 months ago

Very interesting article with lots of links that I'm sure to revisit often. I use Linux daily and was not aware of all the possibilities that systemd has to offer.

Some of the cruft I use nowadays to manage Linux machines can be optimized by simply moving over to the systemd equivalent. Of particular interest to me are: triggers, timers, file monitoring, and ntp.

[-] [email protected] 3 points 10 months ago

Thank you. NTP and DNS are the easiest to get into. Simply enable the services and move on.

[-] [email protected] 5 points 10 months ago

I stopped using resolved as it tends to ignore what I tell it to do and still grab DNS from the router which I don't want and can't disable on the proprietary router.

openresolv/Resolveconf was never broken in the first place so I'm not sure what systemd was trying to fix with this.

[-] [email protected] 7 points 10 months ago

systemd-nspawn is basically chroot but better

[-] [email protected] 2 points 10 months ago

Way, way better. Nowadays its more "basically" LXC. :P

[-] [email protected] 6 points 10 months ago

systemd has made my life so much easier in so many ways. Other people prefer messing with bash files and there are definitely better alternatives for services like systemd-resolved, but basic service and timer management has improved massively.

I wish there was a good GUI for systemd, though. A lot of configuration options have moved to systemd files now, and for novices it's hard to find what file does what and how to configure them. Several Linux distros and desktop environments have their own tools that read from/write to systemd files, but they'll always lag behind the actual systemd resources.

I think an official systemd GUI to manage services and networks would make Linux a lot more usable for people with some computer knowledge but no time or interest in reading man pages. I'd imagine some kind of GUI like Windows has for system services (titled "advanced system settings" or whatever) that can do things like manage network adapters, alter DNS config, start/stop/enable/disable services, the whole deal.

[-] [email protected] 1 points 10 months ago

People have been making services for decades and systemd is 13 years old. I kind of feel like it probably has virtually all of the options its ever going to have. Also most of what people would use such a GUI for is to start stop restart enable disable the thing people have been doing for an eternity which doesn't require even displaying the unit file.

[-] [email protected] 1 points 10 months ago

ah soft reboot ive been waiting for something like that

[-] [email protected] 1 points 10 months ago

systemd is great, but being disingenious isn't helping anyone:

chrony -> sd-timesyncd [...] one less daemon

just because it ships with systemd doesn't mean it magically runs without it's own process

[-] [email protected] 0 points 10 months ago* (last edited 10 months ago)

And yes, Systemd does containers. :)

Are systemd duplicates such as containers and systemd-boot are better than the existing ?

[-] [email protected] 6 points 10 months ago* (last edited 10 months ago)

It isn't always about being better. Docker has its use cases more for single binaries, LXD provides a nice interface while systemd-nspawn is built in and allows you to setup containers with a a common and known unit file. It also allows you to control the containers with the same systemd tools you use for your host machine, zero learning curve and you're less likely to have to enter containers. Another example, I might not want to install LXD/LXC on a low resource system as it will bring snap and waste resources and systemd fixes that.

[-] [email protected] -2 points 10 months ago

Systemd together with NetworkManager are two pieces of software I really dislike. They go against the very Unix philosophy. I like being able to piece all the bricks together on my own, not having monolithic pieces of software that try to do everything.

[-] [email protected] 6 points 10 months ago

Why using Linux kernel then, install GNU/Hurd...

[-] [email protected] 5 points 10 months ago

You make it sound as if it’s a religion … UNIX isn’t a dogma handed down by an infallible being, just a piece of software that made sense for its time. Todays needs are different than the needs 40 years ago, so ofc things have to change.

this post was submitted on 10 Aug 2023
152 points (98.1% liked)

Linux

45457 readers
1567 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS