This article contains one of my pet peeves, in which it says “Leading kernel developers like Linus Torvalds and Greg Kroah-Hartman both enthusiastically praise systemd”, and then links to a talk in which Linus says only that he doesn’t hate it, but that it has quirks. It would be very hard to construe the comments made in the linked video as “enthusiastic praise”, but most people will assume it does, given the link.
Interesting article none-the-less.
Conversely, given what Torvalds usually says about stuff he dislikes…. That’s probably about as close to “Enthusiastic Praise” as you’re gonna get. :-D
“Andy is God”
Linus says only that he doesn’t hate it, but that it has quirks
Yeah, “has quirks”, eh? I figured he just wanted to avoid getting involved in the fight. But how could someone so serious about good software engineering practices not dislike systemd?
I’m convinced systemd represents some sort of malignant takeover of the Linux ecosystem.
One might hope that something as objective as tech and code would bring more objective journalism, but this does not seem to be the case.
But others are quite critical of systemd, criticizing the software’s design for not sticking to the Unix philosophy, in which ‘everything’ is a file.
This is a classic straw man argument and a mischaracterisation of the problem that people have with systemd. Yes, systemd is a departure from the UNIX philosophy. Yes, part of the UNIX philosophy has to do with files. But no, that’s nothing to do with the part that has people worried.
What worries people about systemd is that it’s a departure from the UNIX philosophy of building the system from small, composable parts. Instead it creates a single monolithic “over-manager” with everything from startup to daemon management to cron to DNS to IPC all bundled up in the one massive opaque system. These are all provided as a fait accompli and the user has relatively little flexibility to alter it. This is the way in which it departs from the UNIX philosophy.
Instead it creates a single monolithic “over-manager” with everything from startup to daemon management to cron to DNS to IPC all bundled up in the one massive opaque system.
At least DNS (systemd-resolved) and IPC (dbus-daemon) run as separate processes.
But this highlights another problem with systemd: It’s never quite clear whether “systemd” refers to the whole project or just systemd(1). This leads to a lot of confusion when discussing the “systemd is monolithic” issue.
Sounds like Linux. Is Linux just the kernel, or is it the entire installation?
not one mention of the terrible security practices and needlessly extensive privileges systemd has? no? just BSD users hate it because files??
He’s not exactly renowned for his self-reflection.
I’m pretty sure that putting the file as the most basic concept is complete nonsense because the file is way too specific; it’s way too different from a printer, from a sound card. I definitely have big issues ‘everything-is-a-file’ concept and I think it’s misdesigned.
Seriously? But both have been supported, well, as files. This is bullshit.
Just because we’ve always done it that way doesn’t mean it’s the best way.
Think about it, what is a device file really abstracting? It’s essentially just a socket to some driver. Across that socket you send some sort of thing, usually a binary or text protocol… it sounds an awful lot like an RPC system to me. So why not put the RPC system on dedicated message bus?
Oh look, d-bus.
I make no claims about the quality of d-bus either in design or implementation, however the idea of abandoning magic files for a dedicated message bus makes perfect sense to me.
How much more complicated is it to support in a language-agnostic way D-bus than files? How much fiddlier are permissions for RPC? How many programs have worked longer with files instead of some system messaging facility and more portably?
Oh, and why not just expose the message facility as files anyway?
If you want to play the concept-is-great-just-not-this-implementation, I’ll point out that Plan9 showed that, no really, all you need is files and it works damned well.
How much fiddlier are permissions for RPC?
This is a good point, UNIX permissions are already straightforward and well understood.
How many programs have worked longer with files instead of some system messaging facility and more portably?
More portably? What a fucking joke. Device files on different systems are all totally different. All you can rely on is raw block devices acting like raw block devices, but they don’t even have the same names across systems! Nor are they deterministic, what does /dev/sda mean? It means the Linux kernel chose “a” for that one particular drive. Would FreeBSD /dev/ad0 be the same? What about OpenBSD /dev/sd0? Who knows?
And disk devices are easy. What if you need to configure the device? How do you do that? I’ll tell you how, you use ioctl. Maybe you don’t know about ioctl, and in that case forgive my aggressive tone, but if you think ioctl is simple, portable, and language-agnostic you’re absolutely delusional.
Lets talk about ioctl.
man 2 ioctl_list
int ioctl(int fd, unsigned long request, ...);
Lets think about a sound device as a file. Seems simple right? Just write the audio stream to the device and it plays! A wonderful beautiful abstraction yes? No. What frequency does the sound card take? What if it supports multiple frequencies? Which one is it set to? Is it 16-bit or 24-bit? How do you know? How should you set it up? Music usually comes at 44.1 kHz but DVDs come at 48 kHz, how does your audio device file handle that?
So we need some configuration. Here, you can use these ioctls, which may or may not be supported by your sound card. You will only really know once you call ioctl and see if it fails. But it might return success and silently do nothing, depends on the ioctl. Also, this probably isn’t all of them, however you can read the kernel source to find out if what you need is supported. Files as devices are awesome! Good luck!
Sure, ioctl is a bit of a deranged joke–but again, you’re haggling over one particularly stupid and inbred family of solutions. I’d be similarly silly for saying “messaging is totally stupid” by pointing at SOAP or CORBA.
Again, please, go look at the way Plan 9 handles device options and things as files.
EDIT: And yes, I’m familiar with the problems devices like audio cards and graphics cards present. That said, that makes it even more interesting to have a clean file-based way of introspecting on device state.
I’m not haggling over one particularly stupid solution, I’m describing the current, in use solution that is actually the problem at hand.
Besides, devices are only one example of how the files abstraction breaks down, as kel pointed out. What about other forms of IPC? Or dynamic things such as local service discovery? Are you going to do that all with files? All IPC shalt be done exclusively through named pipes with custom binary protocols, or dead drops on the filesystem?
Are you going to do that all with files?
Search Wikipedia for the plan 9 plumber program. Lobsters seems to be allergic to the link. :(
Is Plan9 actually the likely alternative here? I mean, there is some alternate universe in which it became the standard Unix, and it has some elegance. But despite years of people vaguely admiring it, I don’t see any real move in either the BSD or Linux world towards actually moving the core OS to a Plan9 model. The real debate in Linux-land, especially, seems to be more over Linux old-world vs. Linux new-world, i.e. do you think replacing sysvinit with systemd’s init, and replacing ioctls with dbus, is a step forwards or backwards? If systemd and dbus both went away, I still don’t see Linux adopting a Plan9 model as the alternative.
I still don’t see Linux adopting a Plan9 model as the alternative.
Well, /proc is kinda a low-budget ripoff, and one that frankly wasn’t implemented as well as it could’ve been.
There’s waaaaay too much software and momenturm built up in the Linux ecosystem (and, for that matter, in the BSD ecosystem) to expect any sort of graceful transition to a better model.
Nothing is stopping it, mind you–CADT means that in a decade or so some clever youth with more arrogance than sense could certainly come along and strongarm the ecosystem into doing the right thing; unfortunately, the sort of system we get with 9P is more built on engineering restraint and clarity of purpose, things which don’t usually conincide with the other factors I mentioned.
As for the current debate, well, the linux folks are bikeshedding when a new monorail is sitting, unused, next door.
Plan 9 is explicitly not Unix, said with vehemence by the same people who created both. ‘Adopting a Plan9 model’ would mean that Linux would be a Plan 9, not a Unix. Plan 9 is its own philosophy and family of OS at this point, and while devs have borrowed ideas from it, individual pieces are not necessarily viable or secure without the other parts. See OpenBSD’s justified rejection of /proc.
This discussion mostly kicked off from Poettering’s throwaway argument that “you can’t do sane hardware control through files!”, and there’s been enough documentation presented here that “yes you can, as long as your abstractions are decently thought out”. Much like many other of computing’s “universal” truths, it depends on how you’re looking at it. I gravitate more towards the namespace approach because I’ve been on too many projects where This Time It’s Different™, and “complexity is natural”.
My feelings on the article itself are much like zik’s : service management is a tricky problem, and it’s no sin to move away from strict SysV if you want to(see Apple’s launchd), but systemd and its inventor seem inclined to force it on Linux(as a concept) without understanding the real point of the Unix philosophy.
Again, if that’s the direction the majority want to take, that’s their right. But it is a direct consequence of those views(along with containers) which has had me moving gradually away from Linux towards the BSD and Plan 9 families in the past year.
But despite years of people vaguely admiring it, I don’t see any real move in either the BSD or Linux world towards actually moving the core OS to a Plan9 model.
In some ways yes, in other ways no. For example, ‘mount -t 9p’ works fine on my Ubuntu, out of the box. Namespaces are dead in the water, as well as a lot of the other things that make plan 9 awesome, but there’s nothing preventing people from using the 9p rpc system today, in real systems.
You can use it in userspace yes, but is there any prospect of the kernel using it as the basis of its abstractions and public interfaces? I don’t see any critical mass behind dbus being dropped in favor of a Plan9-esque interface. Instead it seems the debate is between something like dbus, and something that looks more like pre-dbus Linux. Or, alternatively, the “Plan B” is to use the BSD abstractions, either by deciding this is a good time to leave Linux for a BSD, or by importing some of the BSD abstractions to Linux. But either way, not the Plan9 abstractions.
That’s because userspace seems to have decided it wants dbus, at least for now. And that’s kind of what people here are complaining about.
‘userspace has decided’? We’re the users. This is our space. The people who have decided are, let’s be honest and clear, Red Hat.
What is this supposed to mean, other than “everyone other than Red Hat hates systemd?” I like systemd (to the extent that I think it is better than the alternatives) and am not employed by Red Hat. A lot of people feel the same way, but have better things to do than join the latest Poettering flamewar. This forum in particular has a high concentration of BSD users, who are more likely to dislike systemd. I wouldn’t use the mood in here to gauge the overall opinion of systemd.
So you want to extend the filesystem idea so heavily that it’s essentially d-bus? Now you’ve got an RPC system that only supports the signature (string -> string) but is more convenient to use on the command line. I guess if you love string parsing and manual type validation, then sure, why not?
Go read the good links somebody else put up.
Like, I get that you don’t agree with me, but good word you seem hellbent on making the least charitable view of my position you can. There is so much cool stuff that we can get, for free, without resorting to bloated bad reimplementations of ideas a decade after the problem had already been solved and solved well.
D-bus solves it’s problem in a heavy-handed way that makes sense if you’ve never seen a better solution. I’m saying that there was a better alternative out there, even though the ‘nix ecosystem is too brain-damaged to be able to make use of it.
Also, don’t be afraid of simple string messages. They’re not impossible to parse or vailidate…millions of sites get by on that fact every day. :)
As I said, I don’t necessarily think d-bus is a perfectly designed system. But I completely understand why the systemd and freedesktop folks prefer it over a Plan 9 style file system. Instead of heavily modifying the kernel to support an entirely different paradigm of interacting with devices and processes, they made a userspace daemon that translates the existing crap into an interface that’s easier for them to consume in a structured way.
What I’m hellbent on doing is rejecting your statement “Seriously? But both have been supported, well, as files. This is bullshit.” Because no, it’s not bullshit. It’s a rational response to an existing system that can’t just be ripped apart and rebuilt in a totally different way overnight. Sure Poettering may be wrong to criticize filesystems as an interface, but he’s making software for Linux, not Plan 9.
So to address this directly:
There is so much cool stuff that we can get, for free, without resorting to bloated bad reimplementations of ideas a decade after the problem had already been solved and solved well.
No, we can’t get it for free. You can’t put the Plan 9 filesystem into Linux for free. That’s absurd. It doesn’t matter how cool or nice it would be, it’s not happening. Being realistic isn’t bullshit, Poettering is making real improvements to Linux by working with what’s available.
Also, don’t be afraid of simple string messages. They’re not impossible to parse or vailidate
Being “not impossible” to use is a pretty low bar.
In what way is dbus a rational response to anything? It’s a desktop bus. It’s in the name. It starts out life in 8-bit ASCII mode and literally on the same socket moves to binary mode. Why is this as a concept the one true IPC interface, and a filesystem is not? At least the filesystem can be made regular and separate its concerns orthogonally.
You need to escape the parens. https://en.wikipedia.org/wiki/Plumber_(Plan_9)
Everything is a file could be a good abstraction if you could write method calls to the file:
echo 'set_volume(0.9)' > /dev/sound
Hey, guess what I just did for work.
echo command > /mnt/peripheral/devices/ctl
/mnt/peripheral is serving 9p over USB to an stm32f4 microcontroller. There’s a small adapter right now to tunnel USB to a socket, and the Linux kernel knows how to mount it.
My testing is done via some shell scripts, although I could do it with any language.
Are sockets represented as files really “file"s at that point? Makes you think…
“In Plan 9, it’s not "everything is a file”, it’s “everything has the same interface”. And that interface is “file system”."
The pithy “everything is a file” statement also tends to miss the other part that Plan 9 / Inferno emphasize, that of creating custom namespaces(“file systems”) and synthetic items(‘files’) on demand. The kernel shields processes from each other, so process 1’s ‘socket’ ‘file’ is not the same as process 2’s, even though they got their resource(‘file handle’) from open()‘ing the object pointed to by the string “/net/tcp/clone”.
Charles Forsyth goes over this in his talk, and the The Use of Name Spaces in Plan 9 opens with this idea. From a programming language perspective, you might note technomancy’s post on Lua sandboxing by using setfenv() and a table of functions to construct an environment for a chunk of code to run in.
Of course, as noted in Styx on a brick, or The Styx Architecture for Distributed Systems (the PathStar’s hardware interface), this does not remove the need for out-of-band documentation, convention, or forethought. What this does do, is take the complexity and discoverability out of the privileged layers like the kernel, and give them back to the user, where they should be. That’s it.
(Archive.org links provided, as disturbingly cat-v.org seems to be down right now)
Doing the good work with those links. :)
Yeah, ran across that earlier in this conversation, which was mightily frustrating. I hope they’re okay. :( :(
As of 01/28, cat-v.org is up again.
Morbid thought: 9front finally trolled too hard for somebody.
Less morbid: someone probably forgot to pay the hosting bill. (I hope)
You certainly can do everything as files, but as far as I can tell, the movement towards these “messaging bus” type abstractions for RPC is broader than just dbus. Stuff like ZeroMQ, RabbitMQ, even Amazon SQS has gained popularity roughly contemporaneously, in various niches. I am not the person to tell you why people like it though.
You know, that would actually be a cute use of FUSE…creating a /dev/SQS folder where you can just open and write messages or read them.
If files and d-bus are functionally equivalent for this purpose, what is gained by the multiplication of entities? There are decades of tools to work with files and now all those wheels need to be reinvented for d-bus.
Horse-drawn carriages and cars are functionally equivalent, what is gained by the multiplication of entities? There are decades of tools to work with horses and now all those tools need to be reinvented for cars.
It sounds like you believe that there is a convincing answer to my earlier question (“what is gained?”). I’d love to hear it.
See my comment here.
Your comment there does nothing whatsoever to make the case that dbus is an improvement. You argue that POSIX underspecifies paths and that ioctl is messy. You mentioned dbus precisely zero times.
I thought it was obvious why I consider a message bus an improvement over ioctl, just by virtue of how crappy ioctl is. However, here you go:
A message bus adds structure. I personally think structure is good. There’s a reason we have protocols like HTTP, rather than just opening sockets to remote servers and barfing text however we please, inventing something new for every application.
You mean like everyone did REST the same way, sometimes using PUT to mean PATCH and almost no one using the same representation for the exact same concept?
Sure people do things differently, but within the REST camp at least people mostly agree on HTTP+JSON. That’s a step up from a raw socket.
He said that most people who are programmers will eventually learn about object-oriented programming, hopefully at university or another school. They will find that the most abstract concept that object-oriented programming has, how it sees the world, is generally the object. On Unix it’s the file. “I’m pretty sure that putting the file as the most basic concept is complete nonsense because the file is way too specific; it’s way too different from a printer, from a sound card. I definitely have big issues ‘everything-is-a-file’ concept and I think it’s misdesigned.”
Block devices and character devices have been a very successful model for unix. His patronizing tone comes across as infuriatingly arrogant.
His works highly affects the UNIX community, but he keeps trolling it a lot.