News for hackers. Stuff that matters.
Re:A Word about Systemd by mike_d on Tuesday September 17, 2024 @08:28PM (#41574368)
Systemd being one big monolithic system locks you in to, frankly, just a lot of shitty decisions. Take for example the fact that it decides to bind to port 53 on localhost, for absolutely no good reason. Now if your response is that is not a big deal, or you push your glasses up on your nose and want to explain why its important, imagine for a second if it was port 80 or 443.
Re:A Word about Systemd by bigfatkitten on Tuesday September 17, 2024 @08:55PM (#41574548)
I have no real complaints about systemd as an init system. I have plenty to say about systemd not staying in its lane.

systemd's developers have formed a habit of deciding to implement something like an NTP client or DNS resolver, bringing a healthy dose of ignorance of how those services actually work, and then doubling down on their poor design decisions when problems are brought to their attention.

Re:A Word about Systemd by tapoxi on Tuesday September 17, 2024 @09:05PM (#41574618)
But that's systemd the project, not systemd the init system. You don't need to use any of those components to use systemd, which has no dependencies on them. Those services can live and die on their own merits.
Re:A Word about Systemd by bigfatkitten on Tuesday September 17, 2024 @09:09PM (#41574653)
They can ship as much trash as they like, so long as it doesn't become my problem.

Those components become my problem when the distributions I choose to use choose to adopt them, and then I have to work around them.

Re:A Word about Systemd by tuna74 on Wednesday September 18, 2024 @05:11AM (#41577532)
Choose something else then. If there is one thing the world is not lacking it is Linux distros.
Re:A Word about Systemd by bigfatkitten on Wednesday September 18, 2024 @07:55AM (#41578592)
As a hobbyist, sure. It's not quite that simple when I have commercial apps I need to run in a regulated environment.
Re:A Word about Systemd by growse on Wednesday September 18, 2024 @01:57PM (#41583274)
There's nothing about regulated environments or commercial apps that limit your choice to "systemd on Linux".

Everything is a tradeoff.

Re:A Word about Systemd by bigfatkitten on Wednesday September 18, 2024 @05:11PM (#41585553)
Those apps and the system's accreditation requirements limit my choice to a particular vendor's ecosystem so yes, they do.

Otherwise I could avoid Linux entirely if I so chose, and make the systemd consideration irrelevant.

Re:A Word about Systemd by the_real_cher on Tuesday September 17, 2024 @09:33PM (#41574809)
It becomes default on all the main stream distros though.
Re:A Word about Systemd by consteval on Wednesday September 18, 2024 @04:36PM (#41585154)
Which should make you consider its validity. If all these distros chose it, independent of one another, there's gotta be a reason. The reason is that it's much, much simpler and more maintainable from a distro perspective and a sysadmin perspective.

Ultimately distros decide what software is on their distro and users decide what distros to use. So the solution here is to find a distro that meets your needs.

Re:A Word about Systemd by favorited on Tuesday September 17, 2024 @08:36PM (#41574427)
You're right – if I imagine systemd doing something else than what it does, I don't like it!
Re:A Word about Systemd by wongogue on Tuesday September 17, 2024 @08:34PM (#41574408)
Stub resolver for systemd-resolved? Maybe check with what your distribution is shipping.
Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @06:39AM (#41578029)
I believe systemd-resolved being the absolute worst part of the whole systemd ecosystem and especially the way it's packaged into Ubuntu.
Re:A Word about Systemd by jauntywundrkind on Tuesday September 17, 2024 @08:34PM (#41574407)
Systemd doesn't.

The systemd monorepo also provides systemd-resolvd which does, but this is optional and last I checked not included or at least started by default on Debian, for example.

Re:A Word about Systemd by the_real_cher on Tuesday September 17, 2024 @09:12PM (#41574673)
Systemd-resolvd is started by default on my Ubuntu distro v24.
Re:A Word about Systemd by jauntywundrkind on Tuesday September 17, 2024 @11:39PM (#41575533)
Good choice! It's great!

If you really don't want it, it's super easy to disable:

  systemctl disable systemd-resolved
Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @06:42AM (#41578046)
If only it was that easy. Unfortunately, systemd-resolved is a sticky piece. You have to `apt-get uninstall` it, then `rm /etc/resolv.conf` and replace it with a sane file (`nameserver 1.1.1.1` or whatever).

For previous versions I had to `chattr +x` as well because systemd stuff of course will not let me have my resolver.

Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @08:39AM (#41578974)
No, disabling, or at works masking is enough.

`nameserver 1.1.1.1` is insane. Hope you don't ever have to use link-specific resolver.

Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @08:44AM (#41579027)
Indeed. It has to be completely removed from the system and even then there is no guarantee it won't be brought back by some minor update in a couple of days. This is why I had to chattr +x in Ubuntu 22 and older. Not anymore in 24, but we'll see.
Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @08:45AM (#41579048)
resolv.conf is an internal implementation detail of glibc. You are not supposed to touch it.

Congratulation to breaking your system.

Re:A Word about Systemd by jauntywundrkind on Wednesday September 18, 2024 @12:36PM (#41582107)
Wrong and wrong. It just needs to be stopped. And you can mask it to make sure it never ever ever is started by anyone again. C'mon man, 0 for 0 so far on your grumbles.
Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @12:38PM (#41582138)
It absolutely wasn't enough to stop and mask it under ubuntu 22.04.
Re:A Word about Systemd by jauntywundrkind on Wednesday September 18, 2024 @01:07PM (#41582540)
Do you know how to use netstat to see who is holding the port open? This seems like a major Problem Exists Between Keyboard And Chair issue. But also Ubuntu can be a special place. But if you stop the service & the port is still open... It's probably not that service, it's something else, and so throwing shade at systemd is again not accurate.

Ah. It might be a systemd-resolved.socket (or similarly named), allow socket activation. Systemd would warn you when you disable the service that it wouldn't be giving up the socket, that it could still be restarted. Because it's a great monorepo that's smart & courteous.

Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @02:02PM (#41583342)
I think we're confusing two things here. ssh via socket activation is of course a brain damage done solely by Ubuntu. But systemd goes a long way to make sure it hurts, because `ps ax | grep sshd` will definitely show you that /usr/bin/sshd is running. Except it's not it. But maybe that's Ubuntu thing as well, not sure here.
Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @02:38PM (#41583820)
`sudo netstat -nlp` or `sudo ss -nlp` (without root you won't know pid).

`systemctl status ssh` shows, that it is socket-activated:

    TriggeredBy: ● ssh.socket
[Oh, checking the entire thread for context; never mind]
Re:A Word about Systemd by egorfine on Thursday September 19, 2024 @04:57AM (#41589924)
Hindsight.

You would know to run netstat or lsof if you have expected something like that to happen. It certainly wouldn't ever cross my mind to have sshd socket-activated and systemd actively trying to hide the fact. This change by Canonical was out of the blue, totally unexpected.

Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @10:15AM (#41580003)
Link specific resolvers ONLY are insane.

Why am I forced into nothing but link specific resolvers?

Why cant I have a global default resolver anymore, with link specific as needed?

Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @10:23AM (#41580093)
Who said link specific resolvers ONLY?

You can have default one. Chances are, if you have only one configured, it will be default. How are you forced? Who did that? How?

Oth, with resolv.conf syntax, link-specific resolvers are impossible. Even the apple-like extension in /etc/resolver, they cannot respond to link doing up and down.

Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @01:16PM (#41582684)
maybe it's a skill issue on my part.

Can you tell me how to have a default global resolver with resolvd and network manager?

Should be pretty straightforward right?

It's a pretty basic task.

I looked all through the Man pages and couldn't find a way to do it with network manager.

Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @02:48PM (#41583922)
In NetworkManager, you set your DNS servers using `ipv{4,6}.dns`. Similarly, you set `ipv{4,6}.dns-search` with zones that you want to be looked up via DNS over this link. By default, the default DNS is the link with with default route. If you want to designate the default DNS via different link, set up the search for `~.`

Then `resolvectl status` will show you each link, what DNS is configured for it, what domains it will resolve and which one is the default.

Re:A Word about Systemd by johnny22 on Wednesday September 18, 2024 @05:23AM (#41577604)
that is a choice by ubuntu. it is not mandated by systemd itself.
Re:A Word about Systemd by the_real_cher on Tuesday September 17, 2024 @09:15PM (#41574692)
resolvd was running by default on Ubuntu 24.

I was struggling with it while trying to troubleshoot a VPN connection because resolvd automates resolve.conf into a generated file from several other files and will overwrite any other functionality trying to add resolvers to resolve.conf, like an internal VPN company resolver for example.

Why is systemd even touching DNS?

Seems a little outside of it's scope.

This is kinda crazy to me personally when I found out resolvd was doing this.

https://www.man7.org/linux/man-pages/man8/systemd-resolved.s...

Re:A Word about Systemd by tuna74 on Wednesday September 18, 2024 @05:14AM (#41577555)
"Why is systemd even touching DNS?"

resolvd != systemd. It seems like you are mad that Ubuntu changed DNS resolver, but isn't that the actual job of a Linux distro?

Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @06:42AM (#41578051)
the full name of the service is systemd-resolvd...
Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @08:39AM (#41578979)
yes, and full name of coreutils is GNU coreutils.
Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @10:13AM (#41579976)
systemd-resolvd is in the literal systemd code base.

https://github.com/systemd/systemd/tree/main/src%2Fresolve

Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @10:20AM (#41580063)
So are udev and nss modules. It's monorepo.
Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @01:11PM (#41582606)
so if it's

1> in the systemd repo

2> if it's written and maintained by the same people who write systemd

3> if systemd is in the NAME

I don't really know what more is needed to say it a is part of systemd

Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @02:57PM (#41584015)
After a quick check, in 100% of distributions checked, it is a separate package. In many of them, not even installed by default (which is too bad).
Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @09:24PM (#41587525)
okayyy
Re:A Word about Systemd by egorfine on Wednesday September 18, 2024 @06:43AM (#41578055)
I believe systemd-resolved is easily the absolute worst piece of systemd infrastructure. And especially so in Ubuntu! In 24.04 you can get away by uninstalling it then creating a sane /etc/resolv.conf; previous Ubuntu distros required a bit more than that.
Re:A Word about Systemd by vetinari on Wednesday September 18, 2024 @08:43AM (#41579024)
Ideally, with systemd-resolved, you would have only 127.0.0.53 in your resolv.conf. (Anything that reads it directly is broken anyway).

Then you configure your DNS using NetworkManager, on respective connections. I.e. on your VPN, you configure the DNS on the other side of the connection, and (optionally) which zones it is supposed to resolve. (NetworkManager then configures systemd-resolved accordingly). The usage of this DNS then goes up and down together with your VPN connection. That's it.

Re:A Word about Systemd by jdenning on Tuesday September 17, 2024 @08:31PM (#41574391)
Exactly - this is a perfect example of what has always bothered me about systemd.
Re:A Word about Systemd by rerdavies on Tuesday September 17, 2024 @08:57PM (#41574559)
Binding a DNS server to 127.0.01:53 is a perfect example of what has always bothered you about systemd? Seriously not getting it.

Providing DNS services on 127.0.0.1:53 has nothing to do with systemd. It's a convention used by NetworkManager, and associated network services. The very good reason being that network interfaces that are being brought up and down can choose to forward their DNS requests to 127.0.0.1, and allow a completely separate unit (resolved?) to deal with the details of where DNS requests get forwarded from there. (Or not, if they so choose).

Was there some OTHER burning compelling use-case that makes you want to use 127.0.0.1:53 for some other purpose?

Re:A Word about Systemd by the_real_cher on Tuesday September 17, 2024 @09:18PM (#41574702)
From the man pages:

"Additionally, systemd-resolved provides a local DNS stub listener on the IP addresses 127.0.0.53 and 127.0.0.54 on the local loopback interface"

https://www.man7.org/linux/man-pages/man8/systemd-resolved.s...

> Was there some OTHER burning compelling use-case that makes you want to use 127.0.0.1:53 for some other purpose?

The problem is... by default... resolvd routes ALL DNS REQUESTS to this stub by over writing resolv.conf with ONLY that socket and forcing you to configure resolvers elsewhere. And you have to manually reconfigure this if you want to change it and it forces you to get in the weeds way to much when all you want to do is add a DNS resolver.

https://www.man7.org/linux/man-pages/man8/systemd-resolved.s...

The confusing thing is why the heck is SYSTEMD an init system writing DNS resolvers? Seems out of it's scope in my opinion.

I was surprised resolvd existed when I was trying to troubleshoot a DNS error caused by it.

Re:A Word about Systemd by johnny22 on Wednesday September 18, 2024 @05:24AM (#41577607)
resolved is neither started by default on systemd nor required in any way. Your distro chose that.
Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @06:41AM (#41578042)
As most mainstream distros will just to fall in line with the standard.

unless you want to use Arch at some point it will be the default for most Linux.

Re:A Word about Systemd by johnny22 on Wednesday September 18, 2024 @09:12PM (#41587451)
there is no standard. it's just a tool that ships with systemd that some folks use and some don't.
Re:A Word about Systemd by the_real_cher on Wednesday September 18, 2024 @09:23PM (#41587522)
yeah just like systemd right?
Re:A Word about Systemd by rerdavies on Monday September 23, 2024 @02:12AM (#41622784)
Isn't mainstream distros all doing the same thing a Very Good Thing Indeed?