Live data from Hacker News

Why I dislike systemd

steven-mcdonald.id.au

221–230 of 254 posts

Re: Why I dislike systemd

#221

Earlier quoted context omitted.

Indeed. But at that point you have a DSL which is no longer obvious when one only knows about shell scripting (eg. I have no idea what `pexp="smtpd: \[priv\]"` does), so using a completely declarative language with a trivial syntax doesn't seem a huge issue either. One may think about systemd's unit files as a set of shell variables that gets sourced by the real script.

man rc.subr pexp A regular expression to be passed to pgrep(1) in order to find the desired process or to be passed to pkill(1) to stop it. By default this variable contains the daemon and daemon_flags variables. To override the default value, an rc.d script has to redefine this variable after sourcing rc.subr.

Thanks, that wasn't the point. What I was trying to say is that if you use those helpers you're looking up stuff in a man page anyway, so knowing shell scripting isn't enough any longer.

My personal opinion is that having a simple, INI-derived language is better than keeping the weirdness of the shell language just to assign a couple of variables (and you can still launch shell scripts from units anyway).

Re: Why I dislike systemd

#222

Earlier quoted context omitted.

Indeed. But at that point you have a DSL which is no longer obvious when one only knows about shell scripting (eg. I have no idea what `pexp="smtpd: \[priv\]"` does), so using a completely declarative language with a trivial syntax doesn't seem a huge issue either. One may think about systemd's unit files as a set of shell variables that gets sourced by the real script.

> But at that point you have a DSL which is no longer obvious when one only knows about shell scripting At which point you can run `man rc.subr` and be enlightened :)

Yep, my point is that knowing shell scripting alone is no longer enough and it's not different than running `man systemd.service`, only that you're keeping the weirdness of the shell language just to set a couple of variables.

Re: Why I dislike systemd

#223
post #211
post #201

Earlier quoted context omitted.

Polkit is a great idea, don't get me wrong. However: * Like pretty much anything from freedesktop.org, the documentation is a joke. * The security system implemented through it is next to impossible to debug. It's very easy to add "allow to happen", but I can't do things like "ok, tell me who can mount filesystems" or "give me a list of all things that users in the wheel group are allowed to do". Normally this would…

> Like pretty much anything from freedesktop.org, the documentation is a joke. man polkit Looks pretty good to me. It even includes an ascii-art architectural diagram! Here's the webified version: http://www.freedesktop.org/software/polkit/docs/master/polki... > polkit doesn't have a textual interface, it only works through D-Bus. This makes it useless for scripting. polkit(8) and pkcheck(1) describe how to use the p…

> Looks pretty good to me.

Ok, let's put it to a simple test :).

# pkcheck --action-id org.freedesktop.udisks2.ata-standby pkcheck: Subject not specified

# man pkcheck /subject

It means to say that you have to specify a PID for which to check that. But the word "subject" doesn't even appear in the pkcheck manpage.

The synopsis also lists three possible forms for --process. However, only one of them is valid and (the developers currently think) presents no race conditions. There's a note warning that the other two are buggy, but they're still accepted for compatibility reasons, because those two (buggy) methods have been standard for years.

> I think that's the nature of the problem domain. polkit seems to be for enforcing arbitrary rules, when the built-in rules of something like sudo can't cope. Therefore: arbitrary code snippets as rules, therefore, no introspection.

I don't think it's the nature of the problem domain. The "arbitrary rules" can have a user- or group-base restriction. It's an architectural limitation that the system cannot go through the list of all currently enforceable rules and return those that match a particular user.

> However, [...] Gives a list of actions. Use pkcheck to probe for access.

The problem is that pkcheck verifies whether or not a certain process can execute a function. You can sort of hack it to do that, but it's not always effective.

By the way, the reason I need to be able to do it is the following gem:

> There is no guarantee that a function registered with addRule() or addAdminRule() is ever called - for example an early rules file could register a function that always return a value, hence ensuring that functions added later are never called.

This is extremely unpleasant, because you can (I have) run into problems of the following sort:

* I insert a rule with a particular priority that gets registered and runs. Ok, no problem.

* Later on, inserts another rule which returns a value, thus terminating the rule chain before my rule gets to run.

Now all I find is that my own rule is not enforced, but I can't tell why that happens. There's no trivial way to trace the rule chain.

It also doesn't help that errors in rule files seem to go unreported. If you type "heel" instead of "wheel" for a group name, the whole thing will happily carry on, or at least I haven't yet figured out how to look for those errors.

Re: Why I dislike systemd

#224
post #206

Earlier quoted context omitted.

This is indeed annoying; fortunately David Herrmann is working on a new user-space terminal emulator for Linux called KMSCON which uses the same keyboard input code as XOrg (libxkbcommon) so there is hope for improvement. https://dvdhrm.wordpress.com/2012/12/10/kmscon-introduction/

"is", "new", and "KMSCON" are all erroneous there. (-:

Ok, looking at the recent activity (or the lack thereof) in the github repo lets me be somewhat less enthused... but what's your objection to "KMSCON"?

Re: Why I dislike systemd

#225

Earlier quoted context omitted.

http://lkml.iu.edu/hypermail/linux/kernel/1404.0/01537.html

That says nothing about why the systemd folks are entitled to hijacking a kernel flag instead of (more sanely) namespacing their own debug flag, which is the actual bug that was filed (and in turn met with "it's not a bug it's a feature, so go whine to the kernel folks about the thing of theirs that we broke and don't feel like fixing", as if the systemd folks have become one with the Microsoft). Whether or not there…

> That says nothing about why the systemd folks are entitled to hijacking a kernel flag instead of (more sanely) namespacing their own debug flag

"No, we very much expose /proc/cmdline for a reason. System services are supposed to parse it, because it gives a unified way for people to pass in various flags. [...] And yes, that does include "quiet" and "debug". Parsing them and doing something sane with them is not a bug, it's a feature."

http://lkml.iu.edu/hypermail/linux/kernel/1404.0/01488.html

> which is the actual bug that was filed (and in turn met with "it's not a bug it's a feature,

And that is the appropriate response to the bug that was filed, with the title "Do not parse "debug" command line parameter".

The bug report makes it immediately clear that this is not really about a technical problem that ought to be solved - no, the dirty user-space programmers should get their stinking paws off of our good kernel command line flags, how dare they!

Kay pointed out in his first comment that there is already a different parameter that turns on debug output only for the kernel; the reporter said he's too lazy to start using it.

And this is not about "entitlement": there is a clear administrative use-case for systemd using the debug parameter: if your system doesn't boot you want a simple and obvious way to turn on debug logging in all of the relevant plumbing code, whether it's in the kernel, in the initrd or during service startup. You shouldn't have to remember five different parameters because then you'll forget one and your outage lasts 10 minutes longer.

If the bug report had been something more like "I've enabled debug and my system failed to boot" without prescribing a particular fix and leaving that at the maintainer's discretion, it wouldn't have been resolved as NOTABUG but fixed quickly.

Of course, a wiser and more socially skilled maintainer than Kay Sievers would have immediately filed a follow-up bug report, or re-titled the bug report instead of lowering himself to the level of the reporter and playing resolve-reopen ping pong. (Fortunately the systemd project also also has some more patient maintainers like Tom and Zbigniew.)

Re: Why I dislike systemd

#226

Earlier quoted context omitted.

Given also that systemd is Linux-only due to its reliance on cgroups: yes.

That doesn't stop you from having a Linux system without systemd, though.

True (as I know firsthand, thanks to several Slackware-running machines that I own). My remark was just in response to the question of systemd being tied to Linux.

Re: Why I dislike systemd

#227
post #206

Earlier quoted context omitted.

"is", "new", and "KMSCON" are all erroneous there. (-:

Ok, looking at the recent activity (or the lack thereof) in the github repo lets me be somewhat less enthused... but what's your objection to "KMSCON"?

And "your" and "objection" are erroneous, there. (-: Hint: ce7b9f50c3fadbad22feeb28e4429ad9bee02bcc

Re: Why I dislike systemd

#228

Earlier quoted context omitted.

That says nothing about why the systemd folks are entitled to hijacking a kernel flag instead of (more sanely) namespacing their own debug flag, which is the actual bug that was filed (and in turn met with "it's not a bug it's a feature, so go whine to the kernel folks about the thing of theirs that we broke and don't feel like fixing", as if the systemd folks have become one with the Microsoft). Whether or not there…

> That says nothing about why the systemd folks are entitled to hijacking a kernel flag instead of (more sanely) namespacing their own debug flag "No, we very much expose /proc/cmdline for a reason. System services are supposed to parse it, because it gives a unified way for people to pass in various flags. [...] And yes, that does include "quiet" and "debug". Parsing them and doing something sane with them is not a…

Read the rest of the email you linked, where Linus clarifies that systemd's use of the 'debug' parameter seemed to assume that systemd was the only user of it, thus going against the whole point of a readable /proc/cmdline. Thus, feedback loops were caused and pain was created and flamewars were started.

Again, if you shove your hand into a fire, don't blame the hand (or, for that matter, the fire) for your own arrogance and stupidity. Common bloody sense.

Re: Why I dislike systemd

#229

Earlier quoted context omitted.

That says nothing about why the systemd folks are entitled to hijacking a kernel flag instead of (more sanely) namespacing their own debug flag, which is the actual bug that was filed (and in turn met with "it's not a bug it's a feature, so go whine to the kernel folks about the thing of theirs that we broke and don't feel like fixing", as if the systemd folks have become one with the Microsoft). Whether or not there…

Honestly I find that a single global "debug" option would have been useful, instead of having to know which component (the kernel, the ramdisk, sysvinit, sysv-rc, systemd, upstart, udev, whatever) is at fault. Unfortunately such mechanism introduced a feedback loop in the presence of a bug in the kernel. I understand that it would be difficult for the kernel to guard from such loops, but my sincere impression is that…

I agree that such a flag would be useful, too, in which case the systemd folks could very well have consulted with the kernel folks in advance to work out a deprecation path for the kernel-only behavior and an introduction path for a generic behavior that activates the respective kernel-specific and systemd-specific flags.

The problem is that such collaboration didn't happen, and the systemd folks assumed that they were the center of the universe and decided "well fuck the kernel, we're going to use the 'debug' flag for ourselves, everything else be damned", thus causing breakage and flamewars. Had they taken the 10 seconds to write up an email on LKML or somesuch saying "hey, we think the 'debug' flag should apply to everything, not just the kernel; y'all game?", the vast majority of the fallout would have never existed.

Re: Why I dislike systemd

#230
post #218

Earlier quoted context omitted.

It worked before, it stopped after a change in the kernel, another change made the problem disappear: the root of the problem was definitely a bug in the kernel. That said, it's perfectly fine for the kernel developers to clarify that a flag is for their own exclusive use, and indeed it seems that this is how things ended up. Note that there are multiple userspace applications parsing the flags on the kernel command…

> That said, it's perfectly fine for the kernel developers to clarify that a flag is for their own exclusive use Oh for fuck's sake. It's a parameter passed to the kernel . Programs shouldn't parse it for precisely the same reason why Firefox doesn't parse sshd's arguments. I.e. because they're passed to sshd, not to Firefox. It's a ridiculous clunky hack that stinks of large company coding practice: what they actual…

> It's a parameter passed to the kernel.

Just like "quiet", which is totally meant to affect userspace programs.

> It's a ridiculous clunky hack that stinks of large company coding practice: what they actually needed was a way to pass arguments to systemd itself.

Having a global "debug" knob would have been useful when one does not know if the problme lies in the ramdisk, plymouth, systemd, udev, lvm, whatever. Having a systemd-specific flag defeats that purpose.

> The logical way to do that in an OS that has to be portable and flexible is to implement a mechanism for the kernel to pass some of the arguments it receives to init. Because there's no reason to assume that init is going to be systemd, that there's going to be a procfs ready for it so as to be able to read the kernel's parameters, or that the init process can read it for that matter.

The kernel command line, readable from procfs, has been used for this purpose (see the "quiet" flag) for a very long time now.

> what do you mean "this can have unwanted side-effects", it works perfectly fine on my system.

It worked perfectly on every system until the kernel bug triggered the feedback loop.

> The fact that the developers (again, it's a known pattern) decided to play the PR game and call it "expected behaviour" doesn't make it less of a bug.

It was "expected behaviour" in the presence of a kernel bug, which is why it was obviously not generally "expected behaviour" as you seem to imply.

Post reply on HN