News for hackers. Stuff that matters.
Re:Migrate Everything from Linux to BSD by brian_cunnie on Sunday February 07, 2021 @10:54PM (#26060587)
I noticed that, too: the author doesn't mention the many-splendored versions of *BSD. My personal favorite is FreeBSD.

I like Linux, but I have mixed feelings about systemd, especially when I discovered that systemd runs its own DNS server, which prevents the DNS server I wrote from binding to port 53 using INADDR_ANY. Instead, I had to write code to enumerate the interfaces & corresponding IP addresses & bind to each one separately. Systemd's decision to run their own DNS server is a bit of overreach, IMHO.

Re:Migrate Everything from Linux to BSD by LukeShu on Sunday February 07, 2021 @11:22PM (#26060756)
You don't have to use systemd-resolved. Most distros have been using systemd but not systemd-resolved for years. Fedora only just started using systemd-resolved by default in the most recent release.

It's like, yeah, that's a funny thing to also live in systemd.git, but systemd-resolved is functionally a separate product from systemd.

Re:Migrate Everything from Linux to BSD by gautamcgoel on Sunday February 07, 2021 @11:57PM (#26060950)
Yup. My recent Fedora upgrade broke my internet access due to this change. That was eye-opening, kinda turned me off from Fedora.
Re:Migrate Everything from Linux to BSD by axaxs on Sunday February 07, 2021 @11:01PM (#26060614)
This is where I sit. I like systemd as an init system. I find its syslog replacement unneeded overreach, and its DNS server absolute insanity.

So when asked if I like systemd, it's a loaded question. It's great but absolutely sucks, both.

Re:Migrate Everything from Linux to BSD by dTal on Sunday February 07, 2021 @11:08PM (#26060665)
systemd isn't an init system and doesn't pretend to be one [note] - it's OS middleware with ambitions to becoming a distro unto itself. The systemd project assumes responsibility for numerous aspects of the system that have no technical justification for being under the same project umbrella. You might like systemd-homed, for instance, but it doesn't really have anything to do with the functions of init. Calling it an "init system" is like calling KDE a "window manager".

[note] It describes itself as "a suite of basic building blocks for a Linux system" - although in my opinion that implies more modularity than it posesses.

Re:Migrate Everything from Linux to BSD by sjwright on Sunday February 07, 2021 @11:25PM (#26060770)
I just can't get myself worked up over systemd. Every in-principle objection I have to systemd also applies to the Linux kernel itself—but orders of magnitude "worse."

Principles aside, in reality, systemd has been a complete non-issue for me and a massive quality of life improvement for Linux as a desktop operating system.

Re:Migrate Everything from Linux to BSD by IgorPartola on Sunday February 07, 2021 @11:44PM (#26060874)
That’s kind of where I am. I have yet to run into issues with systemd in practice. I suppose I did run into two but they both came down to old style init scripts that didn’t work right and so systemd couldn’t make sense of them.

Is it not possible to turn off things like systemd’s DNS server, etc? I imagine if you care about such things you should be able to reconfigure your OS to use something else instead.

Re:Migrate Everything from Linux to BSD by petre on Monday February 08, 2021 @01:37AM (#26061469)
I run it in practice but I don't trust it enough to run critical services under it (instead I use runit started from systemd) and it does have to much overreach which bit me several times. For instance setting the number of open files and other resource limits. Let's just say I'd rather use runit or even openrc instead.

It is possible to disable stuff like systemd-resolved or systemd-timesyncd but it takes extra work which should be done by installing another package that accomplishes the same task (unbiound, chrony) just like as one MTA replaces another on Debian.

Re:Migrate Everything from Linux to BSD by willismichael on Sunday February 07, 2021 @11:22PM (#26060755)
Honest question, if nobody likes systemd, then why is it still around and why is it so difficult for me to find a distro that hasn't adopted it?
Re:Migrate Everything from Linux to BSD by dTal on Monday February 08, 2021 @12:01AM (#26060966)
I was careful not to include any value judgements in my comment. I simply wanted to lay to rest this "init system" business.

However, you ask a good question. Lots of people do like it, supposedly. But I think there's a large clue to its controversial nature in that people still call it an "init system", and pointing out that it isn't is interpreted by some as an attack.

Basically, it started out as an init system, which was used by Red Hat / Fedora, which was positioned well at a time when certain distros, notably Debian, used crufty SysV init scripts which they wanted to move on from. When Debian adopted systemd, after some debate, every Debian-based distro did too. This wasn't considered a particularly invasive change at the time. But systemd started to expand into its "middleware" position, absorbing vital system functions like udev. Distros which adopted systemd found themselves along for the ride, while distros that didn't increasingly found that software was starting to break, forcing them to maintain forks, or chisel out the piece of systemd that made it work and run it standalone. So was created a network effect that forced even more distros down the path of least resistance into systemd.

Meanwhile, amidst all the grumbling that this bait-and-switch was provoking, the systemd project leaders had an astonishingly bad attitude towards the maintainers of software that they were breaking, which fomented considerable personal animosity on top of the technical resentment. Not only were they driving a horse and cart through the standard ways of doing things, breaking a lot of stuff in the process, they were being rude about it.

So, more or less, people resent systemd because it's difficult to find - or build - a distro without it.

Re:Migrate Everything from Linux to BSD by jcranmer on Monday February 08, 2021 @12:45AM (#26061210)
> When Debian adopted systemd, after some debate, every Debian-based distro did too. This wasn't considered a particularly invasive change at the time. But systemd started to expand into its "middleware" position, absorbing vital system functions like udev.

Your timing is off. udev became part of systemd in 2012. The big Debian debate was in 2013-2014, and was acrimonious enough to eventually cause several of the CTTE members to resign their position over it. One of the core issues driving the Debian systemd debate was the fact that GNOME was planning on dropping support for anything other than systemd-logind (or something like that), and there was definite concern that packages were already making decisions that were forcing everyone to adopt systemd as the only init system.

Re:Migrate Everything from Linux to BSD by dTal on Monday February 08, 2021 @12:48AM (#26061224)
I stand corrected.

I eagerly await the publication of "SystemD: A History" and its subsequent adaptation into a dramatic screenplay.

Re:Migrate Everything from Linux to BSD by SahAssar on Monday February 08, 2021 @03:26PM (#26069642)
You can get it in audiobook form here: https://www.youtube.com/watch?v=o_AIw9bGogo
Re:Migrate Everything from Linux to BSD by mapgrep on Monday February 08, 2021 @01:37AM (#26061465)
> Basically, it started out as an init system... But systemd started to expand into its "middleware" position, absorbing vital system functions like udev.

Not true. From the start it was positioned as much more than an init system. This is clear just skimming the blog post announcing systemd http://0pointer.de/blog/projects/systemd.html

Among other things, it talks about:

-deferring launch of some services until they are needed, to speed up boot

-launching additional services and shutting down others in response to hardware changes (e.g. adding a usb device).

-taking some or all socket management away from daemons so that sockets can be ready before daemons are live or daemons can be shut down when there is no activity

-“babysitting” services including through cgroup based process management

-managing (some of the) access to /home and other directories

It’s quite a broad scoped announcement. Toward the end there is a “short list of other features”, numbered, ending at 20. Under “Where is this going?” he writes, “ The feature set described above is certainly already comprehensive. However, we have a few more things on our plate.”

systemd clearly started out as a broad based solution, and reading through that post, looking at the problems it addresses, and considering that launchd and upstart tackled similarly many issues, it’s clear why it is so broad - the world has changed. In the 70s on a pdp 11 it was sufficient to launch some daemons at boot, keep an eye on getty, and call it a day. Maybe ~50 years later a new, more comprehensive system makes sense? When Linux runs laptops and phones that are endlessly reconfiguring themselves in response to network, Bluetooth, usb, when systems are sleeping and waking routinely, when vastly more services run on a single machine, when conserving battery is important, when boot time can be reduced to seconds if things are better orchestrated? “standard ways of doing things” have changed in every other sector of society, basically, why wouldn’t they finally change in OS service management?

Re:Migrate Everything from Linux to BSD by jsmith45 on Monday February 08, 2021 @12:45PM (#26067667)
Sure, but most of that introductory post was about service management, and mount management, which are two areas the init system was traditionally heavily involved in. Sure, the init system might not technically have concerned itself with either, but a lot of the ordering considerations were very heavily concerned with both of those.

Now, no one will argue that systemd's service management capabilities far exceed what most historical init systems did. Heck, the traditional init system had interior service management to window's Service Control Manager implementation, since the classic init could not for example give a list of running services. And systemd is far more flexible and feature rich than Window's options now.

systemd-boot and timedated on the other hand are pretty darn disconnected from anything a classic init system was concerned with. It does feel like a lot of the non service/mount management parts of systemd are basically a grab bag of random stuff.

Re:Migrate Everything from Linux to BSD by dirkt on Monday February 08, 2021 @02:15AM (#26061654)
> This wasn't considered a particularly invasive change at the time.

It was pretty invasive - I tried to keep using Debian without systemd, but indirect dependencies always brought it in. Until I switched to Devuan.

And the dependencies brought in EVERYTHING. You could no longer mix and match, pick one part from here if it worked for you, and another part from there.

Which lead to the criticism that "systemd is not modular". Which Poettering denied, pointing out that there are modules at systemd-compile time, completely missing the point.

> So, more or less, people resent systemd because it's difficult to find - or build - a distro without it.

And I wouldn't have minded systemd as an INIT SYSTEM - the existing scripts WERE pretty bad. But systemd is like the Borg - it tries to assimilate everything. And it broke quite a bit of existing functionaility along this path.

Re:Migrate Everything from Linux to BSD by nine_k on Sunday February 07, 2021 @11:41PM (#26060859)
Easy answer: Gnome desktop.

Red Hat produced systemd. Red Hat is the major contributor to Gnome. Gnome now refuses to run without systemd. Every major distro wants to carry Gnome, so...

Well, at least some distros offer a choice. Some other distros (Alpine, popular for containers, Void, which powers my laptop) live happily without it. Various shims exist, logind exists to allow running things like Xfce without systemd.

Re:Migrate Everything from Linux to BSD by enriquto on Monday February 08, 2021 @04:55AM (#26062584)
> Gnome now refuses to run without systemd.

Is that true? The gentoo documentation says that you can chose your init system independently of your desktop manager, and puts openrc+gnome as an example:

https://wiki.gentoo.org/wiki/GNOME/GNOME_Without_systemd/Gen...

You can also install GNOME on OpenBSD, which of course does not run systemd.

Re:Migrate Everything from Linux to BSD by 0942v8653 on Monday February 08, 2021 @09:40AM (#26065041)
Not GNOME itself, but Gnome Display Manager:

> After the transition from GNOME 2 to GNOME 3, configuring GDM is only possible through systemd as it no longer supports other init systems.

https://access.redhat.com/documentation/en-us/red_hat_enterp...

Re:Migrate Everything from Linux to BSD by enriquto on Monday February 08, 2021 @10:15AM (#26065578)
not a big deal then, there's plenty of display managers, and you don't even need one to use gnome
Re:Migrate Everything from Linux to BSD by darthrupert on Sunday February 07, 2021 @11:57PM (#26060949)
Because most people like (or at least tolerate) it, but those people are not yapping their mouths about it all the time. IMHO systemd is actually one of the best improvements in the Linux ecosystem in the last 10 years.

You can see the same effect in e.g. politics.

Re:Migrate Everything from Linux to BSD by znpy on Monday February 08, 2021 @03:18AM (#26061980)
Because people like systemd.

It's one of those situations where the minority that doesn't like systemd is just a lot more noisy than the vast majority that likes it.

Easy as that.

Re:Migrate Everything from Linux to BSD by scaladev on Monday February 08, 2021 @01:02AM (#26061282)
Because you only hear the loud minority that's been complaining for the last decade. I've never had a problem with systemd, I remember the days before it became ubiquitous with absolute dread, but I don't spend my days proclaiming my views on every corner of the internet like the opposite side does.
Re:Migrate Everything from Linux to BSD by Spooky23 on Sunday February 07, 2021 @11:41PM (#26060860)
It’s one of those polarizing things for which there is a small group of hyper vocal critics. When people discover something unexpected, they end up googling it and take a trip down the systemd rabbit hole.

The majority of people don’t give a hoot about it.

Re:Migrate Everything from Linux to BSD by axaxs on Sunday February 07, 2021 @11:33PM (#26060818)
Running a distro is a ton of work. Writing your own one off init scripts per package is even more work.

The short answer is...Red Hat has money and threw it behind systemd. Like them or hate them, they are in many ways the deciding fate of Linux systems. So, other distros fall in line. Ubuntu is a contender, but gave in and followed suit too.

Void and Solus are both good distros that don't use systemd. I'd go as far as to call Solus the best out of the box distro ive ever used.

Re:Migrate Everything from Linux to BSD by dTal on Monday February 08, 2021 @12:02AM (#26060977)
You're half right, but writing init scripts is by far the easiest part of not running systemd. As a sibling comment lightly puts it - "various shims exist".
Re:Migrate Everything from Linux to BSD by axaxs on Monday February 08, 2021 @01:14AM (#26061342)
Writing a few is super simple. But distros have tens of thousands of packages. Most people use it or a derivative of Ubuntu, RedHat, or Arch. All provide packages with systemd files. Heck, even most upstream packages are.
Re:Migrate Everything from Linux to BSD by SahAssar on Monday February 08, 2021 @03:23PM (#26069601)
The parent mentions systemd-resolved and you mention systemd-homed. Most distros that use systemd don't use either by default.

IIRC the required parts of systemd are pretty much init-related, service-related (as in starting/stopping services based on certain conditions), udev and journald (which can and is often defaulted to forward to syslog).

Comments like yours make it seem like resolved, homed, nspawn, machinectl, networkd, cgtop, and all of the other utilites and optional daemons are required. They seem more like konquerour in your KDE analogy as in that they are nice if you want to buy into the whole ecosystem but by no means required to use the core program (and many seem to use alternatives instead).

I'm by no means an expert on this, so please correct me if I'm wrong.

Re:Migrate Everything from Linux to BSD by magila on Sunday February 07, 2021 @11:11PM (#26060685)
You know you turn that DNS server off by adding "DNSStubListener=no" to /etc/systemd/resolved.conf right?
Re:Migrate Everything from Linux to BSD by Caligatio on Sunday February 07, 2021 @11:52PM (#26060919)
I recently discovered that systemd supports drop-in config files so I'd recommend putting the changed settings into something like /etc/systemd/resolved.conf.d/disable-stub.conf. That way your package manager isn't upset that files it controls are modified.

I wrote a personal blog post about this (https://www.turek.dev/posts/disable-systemd-resolved-cleanly...) to try to help people out.

Re:Migrate Everything from Linux to BSD by nobody9999 on Monday February 08, 2021 @03:32AM (#26062057)
> You know you turn that DNS server off by adding "DNSStubListener=no" to /etc/systemd/resolved.conf right?

I suppose you could do that. although I prefer: systemctl disable systemd-resolved systemctl mask systemd-resolved

Then it's dead and will stay that way.

Re:Migrate Everything from Linux to BSD by jamiesonbecker on Sunday February 07, 2021 @11:23PM (#26060757)
Then.. why does it exist? More importantly, why is it enabled by default?

Does systemd want to be an init system? A logging system? a dnsmasq replacement?

Re:Migrate Everything from Linux to BSD by nine_k on Sunday February 07, 2021 @11:50PM (#26060908)
Systemd is a replacement for Unix.

Folks at Red Hat noticed that the Linux userland architecture is not convenient for what they would like to build. So they are building systems which replace the traditional mechanisms: first DBus, then systemd, which is an umbrella of many services: init + service monitoring + containers, logging, interactive login, some networking, etc. I suppose that in 10 years a linux kernel + systemd could be a complete system, with little need for other userland.

Re:Migrate Everything from Linux to BSD by jamiesonbecker on Monday February 08, 2021 @12:10AM (#26061016)
> Systemd is a replacement for Unix... I suppose that in 10 years a linux kernel + systemd could be a complete system, with little need for other userland.

'Doing many things, none of them well' is actually the opposite of UNIX.

https://en.wikipedia.org/wiki/Unix_philosophy

Re:Migrate Everything from Linux to BSD by dralley on Monday February 08, 2021 @10:17AM (#26065605)
This needs to be stated yet again apparently - systemd is not one monolothic binary, it's a collection of tools in one repository.

Centrally developing many disparate pieces of software from one repository is what every BSD does so you can hardly argue that it's not "UNIX".

This is setting aside that systemd actually does all of those things better than the tools that came before. journalctl and systemd timers are fantastic. And good luck using the alternatives to manage cgroups.

Re:Migrate Everything from Linux to BSD by jamiesonbecker on Monday February 08, 2021 @10:46AM (#26066026)
A monolith does not necessarily mean a single binary.
Re:Migrate Everything from Linux to BSD by nine_k on Monday February 08, 2021 @12:16AM (#26061056)
Sometimes you want a different balance — say, in embedded systems. If you think about busybox, it does something similar, only doing a better job at looking like the traditional userland.

There is nothing bad about it. What I find bad is forcing everyone to jump on the same bandwagon, no matter which bandwagon. If I wanted choices made for me, I'd buy a Mac.

Re:Migrate Everything from Linux to BSD by tal8d on Monday February 08, 2021 @01:26AM (#26061402)
ugh, I was so excited when my POWER9 arrived... and then I started looking at the OpenBMC stack.
Re:Migrate Everything from Linux to BSD by dralley on Monday February 08, 2021 @12:03AM (#26060981)
There is a "project" named systemd and an "init system" named systemd, in much the same way that there's the GNU project and GNU-$everything.

Nobody says things like "what is GNU? Is it a kernel, a compiler, a libc, a build system, a set of userspace tools?".

Likewise, the systemd project has many utilities under its umbrella, and most of them are completely optional.

Re:Migrate Everything from Linux to BSD by dTal on Monday February 08, 2021 @12:13AM (#26061040)
Hm. GNU exists to unify software under a single philosophical umbrella - the thing that all GNU software has in common is a fanatical attitude to software freedom.

What does all systemd software have in common? What's the unifying principle there?

Re:Migrate Everything from Linux to BSD by LukeShu on Monday February 08, 2021 @12:42AM (#26061195)
I think the best answer is that systemd-the-project tries to be the things that all of the different distros historically had to do themselves, the things that didn't have an upstream, but maybe deserved to have an upstream so that they could be reused by other distros, and maybe benefit from more eyes and more engineering effort.

Each distro used to have to roll their own initscript system (with varying degrees of compatibility), so they made `systemd`. Each distro had their own init script to save/load the backlight state, so they made `systemd-backlight` (if you're going to replace the initscript system, you'll also have to replace the things that the initscripts for that system did). Each distro used to have to roll their own network configuration scripts (Debian's /etc/network, Arch Linux's netcfg and later netctl, ...), so they made `systemd-networkd`.

Some of this class of thing got picked up by other projects; each distro used to have to roll its own initramfs system; today Dracut exists, so systemd won't be doing that (unless the Dracut folks decide to team up with the systemd folks--remember gummiboot? gummiboot renamed to systemd-boot).

In one of your other comments you wrote "in my opinion that implies more modularity than it posesses." While there are some nasty couplings (it'll take some patching to get systemd-nspawn to work on a non-systemd system), you can successfully use many of the systemd modules on an OpenRC system; it is a lot more modular than people give it credit for.

Re:Migrate Everything from Linux to BSD by nikisweeting on Sunday February 07, 2021 @11:21PM (#26060750)
But why does it need to exist in the first place when my system has exactly 0 change in behavior when it's disabled?
Re:Migrate Everything from Linux to BSD by magila on Sunday February 07, 2021 @11:29PM (#26060800)
The functionality provided by the stub resolver is documented in the man page[0]. You may not be using it, but other people are.

[0] https://www.freedesktop.org/software/systemd/man/systemd-res...

Re:Migrate Everything from Linux to BSD by viraptor on Sunday February 07, 2021 @11:36PM (#26060834)
Or disabling and stop systemd-resolved should do the same thing.
Re:Migrate Everything from Linux to BSD by brian_cunnie on Monday February 08, 2021 @11:53AM (#26066984)
Thanks for the tip.

It wasn't quite the solution I was looking for. I wanted my DNS server to "just work" for people who downloaded it—I didn't want to force them to re-configure systemd to accommodate my software.

Tweaking my software to accommodate systemd.resolved took ~4 hours. It was an enjoyable dive, but I'd rather not have had to do it on the first place.

I continue to think it's a bit of an overreach for Fedora to include a DNS server by default.

Re:Migrate Everything from Linux to BSD by Spivak on Sunday February 07, 2021 @11:24PM (#26060767)
I swear at this point there is not a soul that really understand the low level pieces of a Linux distro fit together.

systemd-resolved is a separate project from systemd whose only relation is that it’s in the same repo. It’s up to your distro builder to decide if they want to use it. And also up to your distro if they want to use the stub resolver. It’s not necessary for systemd-resolved to work. The reason they have the stub listener is because on Linux every application is supposed to use glibc nss to resolve names but there are real-world applications that try, incorrectly, to parse resolv.conf and do dns queries themselves. This breaks things if your assumption is that all dns queries are going through systemd-resolved. And this project isn’t the first. Ubuntu and others have used dnsmasq as the stub resolver for the same reason. Using just the dns nss module and resolv.conf is fundamentally broken and at this point unfixable when you are connected to multiple networks or with separate dns or split tunnel VPNing. You have to provide your own, smarter, nss module and/or use a stub resolver to cover these use-cases.

Re:Migrate Everything from Linux to BSD by dTal on Monday February 08, 2021 @12:05AM (#26060987)
Why does it use the same repo, exactly?
Re:Migrate Everything from Linux to BSD by mariusor on Monday February 08, 2021 @05:02AM (#26062637)
Because it's built by the same people that built systmed and uses some of the low-level internal libraries from systemd (input parsing, configuration, etc) ? This is not that difficult of a conclusion to get to honestly.
Re:Migrate Everything from Linux to BSD by znpy on Monday February 08, 2021 @03:07AM (#26061917)
Fair things about DNS, you can make systemd not work without systemd-resolved, btw.

The nice thing about systemd-resolved is that it make enabling split-tunnel vpns a breeze.

Re:Migrate Everything from Linux to BSD by 1_player on Monday February 08, 2021 @04:49AM (#26062543)
And provides out of the box DNS caching, like any modern operating system.

Do Linux users really want their year on the desktop, or will they keep complaining at any change to get there?

Re:Migrate Everything from Linux to BSD by horlux on Sunday February 07, 2021 @10:58PM (#26060604)
you'd probably like voidlinux
Re:Migrate Everything from Linux to BSD by Qub3d on Sunday February 07, 2021 @11:47PM (#26060892)
For people who use Arch, Artix is a fork that offers a choice of init systems. You still get the AUR and rolling release, but you can use runit (void's init system) instead of systemd.

Worth a shot! https://distrowatch.com/table.php?distribution=artix