Live data from Hacker News

Why I dislike systemd

steven-mcdonald.id.au

231–240 of 254 posts

Re: Why I dislike systemd

#231

Earlier quoted context omitted.

> 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.

Except that rc.subr is shell scripting alone. It's literally a shell script that gets sourced into another shell script (in this case, your initscript), which is - again - ordinary shell behavior. Yeah, you have to learn a couple of shell functions and variables, but that's not really that big of a deal for someone with even cursory knowledge of shell scripting.

The bigger point, though, is that if your only goal is to have terse daemon configuration with a minimum of boilerplate, you can already do this with shell scripts. Even if you decide that shell scripts are the spawn of the devil and ought to be burned on the stake (which, honestly, isn't all that unreasonable of a decision), it's quite possible to implement the same functionality using Ruby or Python or Perl or C or Go or Rust or Erlang or Lisp or PHP or COBOL or MIPS assembly or whatever-the-hell-else you feel like writing init "scripts" in (with some exceptions; FreeBSD and NetBSD, for example, apparently launch initscripts with 'sh' instead of following the OpenBSD and GNU/Linux approach of calling initscripts as executables).

The biggest point, though, is that because of this, if your only goal is to have terse daemon configuration with a minimum of boilerplate, you can have that without having to learn at minimum two languages (one to write your initscripts and one to do all the rest of your day-to-day administration tasks). You just learn shell and you're done. With systemd, you still have to learn shell scripting for even systemd-related tasks (let alone non-systemd-related tasks) plus a new DSL that looks like INI but isn't quite INI. I guess that's tolerable coming from, say, the Windows world (where you're learning DOS batch language and PowerShell and VBScript and INI and Lord-knows-what-else), but that's double what a seasoned Unix admin requires in a non-systemd environment, which is pretty significant.

Re: Why I dislike systemd

#232

Earlier quoted context omitted.

The nice thing about initscripts, though, is that you can get the best of both worlds by sourcing in common functions, as is the default and recommended practice on OpenBSD. For example, here's the initscript for dovecot on my (OpenBSD-running) mail server (with some comments and newlines omitted for brevity): daemon="/usr/local/sbin/dovecot" . /etc/rc.d/rc.subr rc_cmd $1 Pretty straightforward: you set $daemon to th…

That is the crazy part, systemd at its core is a reaction to sysv (and upstart). In part part the reaction is to the boilerplate nature of sysv scripts, as they bring all their logic with them. but if you glance outside the RH/Debian sphere you find the likes of Slackware, that has been using BSD style init for decades.

Slackware's a bit of a peculiar case. It does indeed use /etc/rc.d in a somewhat-BSD-style manner, but there are two key differences:

* Slackware doesn't use a BSD-style /etc/rc.conf. Instead, daemons are enabled/disabled by setting the executable flag on each initscript. While this loses some of the features of /etc/rc.conf, I personally like this method better.

* Slackware doesn't include an equivalent to /etc/rc.d/rc.subr, which means there's a lot of boilerplate in its initscripts.

But yes, systemd's primary objections to shell-based init systems in general seem to stem from a limited scope.

Re: Why I dislike systemd

#233
post #217

Earlier quoted context omitted.

Never heard about it, is there any link with more details?

https://bugzilla.redhat.com/show_bug.cgi?id=753882 Enjoy.

Interesting read, thanks!

However I would not characterize that as "Poettering completely misunderstanding a perfectly valid use of su".

It seems a quite complex issue about a workflow that is only half-working even without systemd. A systemd patch has been committed that fixes the most blatant error, but of course it doesn't solve all problems since most of them existed before systemd.

Re: Why I dislike systemd

#234

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 "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 arrog…

If you discount the usual Linus style hyperbole from the rest of that mail, the only thing that remains is that Linus is unhappy with the fact that Kay closed that bug report instead of trying to find the root cause of the reporter's boot failure.

Re: Why I dislike systemd

#235
post #227

Earlier quoted context omitted.

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

:-) Thanks, I totally missed that.

Re: Why I dislike systemd

#236

Earlier quoted context omitted.

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 w…

> 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"

Note that even Linus said that "parsing [the 'debug' and 'quiet' flag] and doing something sane with them is not a bug, it's a feature". So the issue revolved on what people believe is "sane", not about userspace using kernel bootparams (systemd still does and Linus is ok with it). The systemd folks argued that the kernel should not affected if something broke and started throwing too many messages at it during early boot (indeed, the kernel was fixed to rate limit in those cases). The kernel people instead said that it's not ok for userspace to flood the kernel, not even in broken setups (indeed, systemd was fixed to stop sending messages to dmesg as soon as journald is up).

I believe that sending emails here and there to ask "it's ok to do that?" would not work. LKML is already high traffic as is, such messages would just get ignored until things break.

Re: Why I dislike systemd

#237
post #218

Earlier quoted context omitted.

> 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. Havin…

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

What userspace programs interpret the quiet parameter?

Genuine question. AFAIK, quiet does (or should do) nothing other than disable some of the kernel logging.

> 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.

Yes, and it would have been very useful if the systemd team had offered to implement such a feature, instead of silently pretending to have it.

That thing was news to everyone. Except Kay Sievers, apparently, who chose to share the big news with the world when closing the bug report.

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

By what non-broken programs? There's no reason to even assume procfs will always be there, let alone that the kernel will expose its boot parameters through it. AFAIK, quiet doesn't affect anything but the kernel's logging.

With obvious exceptions (e.g kernel debugging tools and the like), that shouldn't happen.

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

No no. It worked perfectly because the systemd team never bothered to see what happens when the kernel actually tries to use the debug flag, too (i.e. when an assertion actually fires). It should be obvious to anyone who's been programming for more than an year or so that, when you start parsing arguments that aren't yours (which is bad enough in the first place!) you should at least ensure that you don't break the program that uses it.

Yes, the rate limit for /dev/kmsg was increased when it turned out there was a potential to incapacitate the system by flooding the kernel with data from userspace. For what it's worth, if a program did that on Windows, every half-assed heuristic detection engine would have promptly flagged it as malware.

> 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.

How the hell is "I'm passing an argument to the kernel and a program from userspace decides to interpret it" expected behaviour? If I pass rw, too, should I now expect mount to mount every system as read-write?

Re: Why I dislike systemd

#238
post #217

Earlier quoted context omitted.

https://bugzilla.redhat.com/show_bug.cgi?id=753882 Enjoy.

Interesting read, thanks! However I would not characterize that as "Poettering completely misunderstanding a perfectly valid use of su". It seems a quite complex issue about a workflow that is only half-working even without systemd. A systemd patch has been committed that fixes the most blatant error, but of course it doesn't solve all problems since most of them existed before systemd.

I don't know in what corner of the universe was that "only half-working". It was working absolutely fine. It has been working fine since... I don't know, v7, when it was first introduced.

Re: Why I dislike systemd

#239

Earlier quoted context omitted.

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.

Except that rc.subr is shell scripting alone. It's literally a shell script that gets sourced into another shell script (in this case, your initscript), which is - again - ordinary shell behavior. Yeah, you have to learn a couple of shell functions and variables, but that's not really that big of a deal for someone with even cursory knowledge of shell scripting. The bigger point, though, is that if your only goal is…

> Except that rc.subr is shell scripting alone.

Again, "read the source" is a sad answer. I can read systemd C sources too, but given that it comes with proper documentation there should be no need to do it.

My point is that either one has to get some domain-specific knowledge or they have to reverse engineer some code. Given that I believe that the second one is a bad choice (people will rely on the implementation rather than on the intended interface) if you have to get some domain-specific knowledge it does not matter if you're using posix sh syntax or a INI-style one.

> your only goal is to have terse daemon configuration with a minimum of boilerplate, you can already do this with shell scripts

Literally nobody ever claimed that systemd "only goal" is to have terse daemon configuration. It was one of the many goals. Sure, it could have been done with posix sh syntax, nobody disputes that, but since backward compatibility was being dealt in other ways (using LSB header), switching to a INI-style format seems a good choice if one wants to enforce a declarative-only style.

And if someone claims that init script are needlessy complex and redundant it is because that's the situation of most distributions before the switch to systemd. Switching to OpenRC would probably have fixed that aspect, but systemd solves many more problems that distributors faced and OpenRC did not address, faring more positively in a costs/benefits analysis.

Re: Why I dislike systemd

#240
post #218

Earlier quoted context omitted.

> 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. Havin…

> What userspace programs interpret the quiet parameter? > Genuine question. AFAIK, quiet does (or should do) nothing other than disable some of the kernel logging.

At least plymouth and probably every init system out there.

Linus said that "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

> 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!

You're right that Kay was wrong to close the bug immediately instead of trying to help finding the real cause, and you're wrong when you say that userspace should not parse the kernel command line, see Linus' remark above.

> There's no reason to even assume procfs will always be there

To the contrary, dropping it would be an ABI break so it's really safe to assume that it will be always be there.

> who's been programming for more than an year

Please, don't lecture others about their job. I'm not assuming you're an incompetent fool, please don't assume I am.

> if a program did that on Windows

And can we try to stay relatively on topic? Windows is definitely unrelated.

(I'm not otherwise replying in detail because you assumed that parsing the kernel command line was not ok, while Linus officially blessed its usage. Also we reached the max thread depth on HN, which should probably suggest something.)

Post reply on HN