Live data from Hacker News

Avoiding Complexity with Systemd

mgdm.net

181–190 of 357 posts

Re: Avoiding Complexity with Systemd

#181

Earlier quoted context omitted.

If you can't opt out of systemd-resolved due to job policies, that's really not systemd's fault and there's nothing they can do to solve that situation. Why complain about it in that context?

What does this have to do with job policies? Systemd was forced down our throats by Red Hat adding hard dependencies on it to other software under their control, e.g., GNOME. Other distros then adopted systemd under duress, since many of the packages that Red Hat made depend on it are important to the Linux ecosystem, and the other distros didn't have the resources to fork them all.

The point is that the replacements being talked about, systemd-resolved for dns, systemd-timesyncd for ntp, and systemd-networkd for whatever else you would prefer to use for network config, are not a mandatory part of systemd. You can use systemd without using these other components and it will work perfectly well with whatever other services you want to use for dns, ntp, and ip networking. These other services are not dependencies of GNOME, either.

People are conflating systemd itself with all the optional services it comes bundled with. I don't even believe resolved and networkd are enabled by default, at least not by the vendor. Whether a distro enables it depends on the distro.

Re: Avoiding Complexity with Systemd

#182

Earlier quoted context omitted.

This would be a comment with two parts. First one will be counterarguments, second will be a generalized response. Please bear. Part One: --------- > systemd-resolved is not enabled by default in Debian and many distributions, and it is not needed in any way by systemd. If you don't like it, don't use it! It's not possible to ask systemd about which parts are enabled and up to which extent. It always adds a discovery…

>It's not possible to ask systemd about which parts are enabled and up to which extent. It always adds a discovery phase before starting to make changes in a system. If you don't do this discovery, you're probably in a wrestling party with systemd. If you do this discovery, it costs you time. Systemd SHALL provide a way to see how much of its enabled up to what extent. It absolutely is possible to do this. It's the s…

Just want to add, when you systemd list-unit-files | grep enabled, you do need to know the first field is the actual state and the second field is the vendor default state.

But this comment is totally right. If you're a Linux sysadmin, how hard is it seriously to type into a search engine "systemd list enabled services." Exactly this command very helpfully comes up in DuckDuckGo's knowledge graph bubble so you don't even need to follow the link to askubuntu. I'm sure Google search does the same.

Re: Avoiding Complexity with Systemd

#183
post #167

Use NixOS and you'll love systemd. You'll be defining your own systemd units with ease. systemd to you will be journalctl and systemctl. So pretty good.

> Use NixOS and you'll love systemd. I use NixOS but certainly not love systemd. Instead, I've created a way to replace it with s6.[1] 1: https://sr.ht/~guido/nixos-init-freedom/ Cheers, Guido.

That's nice and it showcases how Nix can create a declarative process management atop a script-based imperative manager. How is your experience with it? Also note that there's https://github.com/svanderburg/nix-processmgmt, a manager agnostic processes management framework supporting s6 among others, but your way seems a bit more straightforward.

Re: Avoiding Complexity with Systemd

#184
post #157

Earlier quoted context omitted.

But python programs are much more complex than init scripts systemd replace. It is more like people hate change and are lazy to learn a new thing.

Mamagement has 99 problems. Holding a status quo is about minimizing the backlog more than hating change as such. Even when we can show am improvement in security and usability, and lower training cost because of consistency, it's still another mouth to feed.

If it provides sufficient benefits (which systemd does), it is a no brainer.

Re: Avoiding Complexity with Systemd

#185
post #179

The title is an oxymoron. Putting a huge complex piece of software between yourself and "complexity" doesn't make the system less complex.

Agreed. One point is that processes other than root cannot start services on ports However, with single-serving services (e.g. in vm/container/vps/cloud), there is no need for it. BSD lets you configure it with a sysctl option. But Linux defends that option like it is still 1990. On NixOS, I patch it like this: boot.kernelPatches = [ { name = "no-reserved-ports"; patch = path/to/no-reserved-ports.patch; } ]; With the…

Does it really change anything running something on port 90 rather port 1090?

Re: Avoiding Complexity with Systemd

#186
post #99

Earlier quoted context omitted.

It happens but it’s not clear what you intend to say with that, so maybe just say it? I don’t think the systemd team could have imagined the success and scope of the project from day 1. Another explanation for their success is that the team was onto something, and by using proper engineering practices (work incrementally on pieces that are individually useful) became successful. Think T S Kuhn’s progressive research…

I'm saying that I don't think reasoning by considering questions like « How likely is it that the prolific systemd team and tech decision makers in Linux distributions don’t have a design instinct and came up with this ball of mud full of accidental and unneeded complexity? » is likely to be fruitful. If people want to discuss whether systemd is well designed, it would be better to look at the design directly.

Agreed that this line of questioning is not likely to be fruitful. The alternative of discussing the design would have my preference normally, but i am not sure that it works any better for this hyper polarized topic.

Re: Avoiding Complexity with Systemd

#187
post #148
post #139

Earlier quoted context omitted.

Not going to really argue here, but I have to use mlocate every single time I want to find a unit file, because there's no telling where it would be. Perhaps blame lays on the distro packager, but still, it ends up to a user being strange.

For what it's worth: systemctl | grep ssh systemctl cat sshd I find it useful to find the unit name, and 'cat' displays the location.

thanks, I had no idea that existed.

Re: Avoiding Complexity with Systemd

#188
post #104

Earlier quoted context omitted.

1. This can, and should, all be done without systemd, and not with idiosyncratic shell scripts and guesses. 2. Some of the systemd logging is binary, so good luck with that if there's a problem. 3. Have you tried non-systemd init systems other than sysvinit? 4. Yes, it is convenient when everything below your development is cenrtalized by a single entity. It can easily provide a consistently useful underpinning. But…

I really don't understand the scenario where binary logging is a problem. journalctl is a command just like, I dunno, gzip, and people are fine with gzipped logs. If something goes horribly wrong with your system, you're not looking at logs with an oscilloscope, you're looking at logs by mounting the disk on some other working OS - whether it's the initramfs, or a live CD, or whatever. You can run gunzip (Not to ment…

> You can run gunzip It's subtle, and you've accidentally missed it like many do - you made an assumption that everything logs through journald. On my personal system where I do not have rsyslog (aka trying to live the journald life) I have non-journald text logging for: httpd, sa (sar/sysstat), lightdm, audit, atop, Xorg, cups, fdsync and samba. If we just stick to httpd, sa and samba (most folks know how those work) it shows how logging is way more complex than what is captured in the journal - these apps by design maintain their own logs.

So now you launch your rescue ISO (let's assume modern sysrescuecd which has journalctl) and get your filesystems mounted, you have to employ two different techniques - journalctl for that single-use format and then your traditional find/grep skills for everything else. You don't know why it crashed, how it crashed and are on a fishing expedition. Was it an RPM upgrade? (logged to yum.log or rpm.log, not journald) Was it update-initramfs running out of disk space truncating your initrd? (sometimes logged to journald depending on distro, sometimes not). Don't know until you start following breadcrumbs, find/grep is the superior toolset (much like the trebuchet is the superior siege weapon).

It's not that you cannot do it, it's that journald-only (no rsyslog) forces using a specific method with specific tools to access what should be extremely easy to access data. Keeping logging all in the same format (text) is what I want, it's not that I don't know how to use journalctl; I don't want to use journalctl, it's a pig in lipstick.

> (Not to mention UNIX has log files that have been in a binary format since time immemorial, like utmp and wtmp.)

I agree with this, they belong over in /var/lib/ somewhere and those files bug me, always have. "Just because these other guys did it" is however a logical fallacy, they are (IMO) just as wrong because they're more like database files than they are logs in my opinion. (the secure/auth.log is more a "log")

Re: Avoiding Complexity with Systemd

#189
post #152

Earlier quoted context omitted.

But system init is a hard, complex problem. You can’t create a simple solution for that, since there is an inherent complexity. I prefer systemd over having a bunch of bash scripts trying to do service restart, logging, dependency management and failing at it. You would still get the same complexity but at a different (worse) level.

> But system init is a hard, complex problem. It's not. Read the shell scripts that openbsd uses to init. Simple, straightforward, easy to understand.

The complexity is buried in the huge work the OpenBSD devs make to keep the kernel and the base system small, elegant and consistent.

I read your comment more as a tribute to the excellent work of the OpenBSD team than a denial of the thesis of the complexity of the init process.

Re: Avoiding Complexity with Systemd

#190
post #26

This should be part of the manual. Ive tried multiple times to understand systemd deeper than a service restart here and looking at logs for a unit there to no avail.

I've found systemd to be quite well documented. Here's a few of the resources I frequent:

Systemd docs: https://www.freedesktop.org/software/systemd/man/index.html

List of directives: https://www.freedesktop.org/software/systemd/man/systemd.dir...

Unit-specific configuration: https://www.freedesktop.org/software/systemd/man/systemd.uni...

Service-specific configuration: https://www.freedesktop.org/software/systemd/man/systemd.ser...

Timer-specific configuration: https://www.freedesktop.org/software/systemd/man/systemd.tim...

Post reply on HN