Slashdot Mirror


Kernel DBus Now Boots With Systemd On Fedora

An anonymous reader writes "Red Hat developers doing some holiday hacking have managed to get a bootable system with systemd + KDBUS on Fedora 20. KDBUS is a new DBus implementation for the Linux kernel that provides greater security and better performance than the DBus daemon in user-space. Systemd in turn interfaces with KDBUS for user-space interaction. Testing was done on Fedora 20 but the systemd + KDBUS configuration should work on any modern distribution when using the newest code."

33 of 341 comments (clear)

  1. Why, oh why? by Anonymous Coward · · Score: 5, Insightful

    Why do we need in-kernel DBUS implementation. And please don't tell me about performance, lot's of software with much higher performance requirements is more than happy in userland...

    1. Re:Why, oh why? by armanox · · Score: 4, Informative

      Canonical is innocent - it's Red Hat's doing. Just like Pulseaudio and a million other innovations (some good, some less then good). But Red Hat has had a hand in most of the desktop development that people see.

      --
      I'm starting to think GNU is the problem with "GNU/Linux" these days.
    2. Re:Why, oh why? by Anonymous Coward · · Score: 4, Insightful

      We don't need in-kernel DBUS. Userland can run such things just fine. Is there a "need for speed" and prompt response? Well, so raise priority of the userland dbus daemon then. Right up to real-time priority if need be. That works for jack, which have real-time constraints that can be hard to meet. It works for robot control software. So surely a userland approach will work for something as benign as dbus.

      You can even run a linux system without any dbus at all - it is definitely not needed in the kernel.

    3. Re:Why, oh why? by Anonymous Coward · · Score: 3, Insightful

      Lennart Poettering, nothing he touches is easy to remove once it has a foothold. And it seems everyone who packages it is drinking the same coolaid. Sometime I wonder if packaging tools should have a 'shit can list' that allows packages to be block per developer.

      Just blocking this guy would prevent pulseaudio, systemd and avahi.

    4. Re:Why, oh why? by sjames · · Score: 3, Informative

      The biggest audio performance boost I have gotten was when I killed pulseaudio so that everything would use ALSA.

    5. Re:Why, oh why? by jcdr · · Score: 3, Interesting

      I good reason is the future possibility to manage kernel features in a more formal way than with the /proc or /sys interfaces.

      It has taken about a decade to bring a standard IPC protocol to Linux. I mean a protocol that truly work between applications from different team of developers.It's now time to use it from a wider audience. Making it part of the kernel not only make it a bit more fast, but it clearly make it a more appealing choice for applications that need IPC.

    6. Re:Why, oh why? by Sri+Ramkrishna · · Score: 4, Informative

      KDbus is being done by Greg K-H of Linux Foundation. There are some good reasons for having a kernel bus. The first rev was killed, but the second rev is being worked on. Linus has already signed off on getting this integrated. It's just a matter of working out the details. A lot of this is driven by desktop projects, so things like smooth transition to a login screen, wayland, application sandboxing are good reasons to have it.

    7. Re: Why, oh why? by Sri+Ramkrishna · · Score: 3, Interesting

      Surely, all you really need is something like fvwm2 or something right? I mean, two bars, some extra stuff, and you're good right? The only thing is that you don't have compiz effects. But otherwise, you'll probably have a pretty useful desktop with full control.

    8. Re:Why, oh why? by x_t0ken_407 · · Score: 3, Insightful

      Amen to that. I was mildly irritated when I first saw systemd take over Fedora (I forget what release it was), so I moved to Arch Linux -- which I figured I could count on to be the Unix-like system I always loved and forever adhere to the K.I.S.S. philosophy...then they ALSO shoved systemd down our throats. Have been using FreeBSD on the desktop [where practical] ever since; it was already what I used on my servers.

    9. Re:Why, oh why? by multi+io · · Score: 3, Interesting

      I good reason is the future possibility to manage kernel features in a more formal way than with the /proc or /sys interfaces.

      What's wrong with /proc and /sys for kernel and hardware configuration tasks? It's easy and twekable, you can poke around in it without writing a program first, and it conforms to "everything is a file".

      It has taken about a decade to bring a standard IPC protocol to Linux. I mean a protocol that truly work between applications from different team of developers.It's now time to use it from a wider audience. Making it part of the kernel not only make it a bit more fast, but it clearly make it a more appealing choice for applications that need IPC.

      IPC is between processes, not between a process and the kernel.

    10. Re:Why, oh why? by kernelpanicked · · Score: 3, Interesting
      --
      Ubuntu: If at first you don't succeed, blindly slap a sudo in front of it
  2. More Bloat ? by fluffy99 · · Score: 5, Insightful

    Why is this NOT another example of kernel bloat, and the opposite direcion they should be heading (ie getting user stuff out of the kernel)? Seems like the primary use of D-BUS is for the desktop components, which already abuse/overuse inter-process communication. The "huge performance improvement" is only for those processes that shouldn't be abusing this anyway.

    1. Re:More Bloat ? by SumDog · · Score: 3, Interesting

      I like Gentoo's OpenRC. Much better than SystemD.

    2. Re:More Bloat ? by fnj · · Score: 3, Informative

      Can someone please step up and write a sane rc.d based init system so we can consign Systemd to the trashcan of history.

      Seriously? BSD has had such a system forever. Linux used to have a "sane" init scripts system (admittedly for some subjective definition of "sane") until very recently. Debian's system used clean Bourne shell compatible scripts. This meant /bin/sh could be a symlink to /bin/dash. Dash is a very lightweight shell without all the Bash overhead. It is about 1/10 the size of Bash. Bash is an excellent interactive shell, and a very valuable scripting shell, but Dash is excellent to have where you don't need a vast profusion of features but you are interested in performance.

      Here we learn that most of the performance benefit seen in Ubuntu 6.10 was due, not to Upstart, but simply by switching from Bash to Dash in the init scripts.

      Redhat decided it was "too hard" to make their init scripts Bourne shell clean. They all reference /bin/sh in the shebang line, but they lie. They rely on Bash features. As a result, rather than do what Debian showed could readily be done, Redhat established and has adopted Systemd as the Only Supported Init System.

      Now that Debian is caving in to systemd, it seems safe to say we can forget the fantasy of Systemd being relegated to any kind of "trashcan". Quite the contrary, as far as linux is concerned, it is the init script system that will be trashcanned.

      There are honest pros and cons for the move. The pros are pretty compelling (and I say that as a holdout from the beginning). Linux is in many ways about monolithic solutions. This is just one of those ways.

      For those who have doubts, not just about Systemd but about other monolithic consolidations and discarding many time tested and good working systems, there is still a refuge: BSD. That may change, but for now BSD is not jumping on all this stuff (quoting the AC near the top: Wayland, Gnome3, Pulseaudio, Systemd, Journald, "Alienating [subsuming] Udev"). BSD is still all about the Unix Philosophy, as expressed by Mike Gancarz.

      It is really an embarrassment of riches that BOTH Linux and BSD are prospering as freely available systems.

    3. Re:More Bloat ? by salahx · · Score: 3, Informative

      hHe short version: http://lwn.net/Articles/551969/

      At first, this sounds like the kernel developers have raided LP's "private stash", but it turns out the reason for kdbus is preceeds it - in fact in even preceeds d-bus itself. Specifcally, kdbus is intended to be a alternative version of Android's binder. Android doesn't use d-bus, because it didn't exist (or was too immature) back when it was concieved. While binder is in the staging tree, it'll never be part of the kernel proper for various - some fixable, other unfixable. Binder is not just a hard pill to swallow for the kernel developer, its a spiked ball the size of a fist in a bottle labelled "NOT TO BE TAKEN ORALLY".

      There's a NEED for something like kdbus independt of systemd. We needs a new IPC type, like domain sockets, except with reliable multicast and filtering. Linux domain sockets do not support multicast, much elss reliable multicast. Approaches to add this have been tried: Both by directly adding multicast to domain sockets or by adding an ew address family (AF_DBUS), but patches adding that to unix domain sockets have been rejected, as has AF_DBUS.

      No one suggesting putting the entire dbus-daemonm and protocol in the kernel with kernel XML parser (and so dbus-daemon will still be needed for authentication and the inital connection setup, but then steps out of the way after that), kdbus is "just enough" to implement an accelerated and robust message bus.

  3. So this is the thing killing portability by Improv · · Score: 3, Insightful

    The corruption of GNOME and other opensource projects by tying it specifically to Linux comes with this; it represents giving up on being cross-platform, giving up on the BSDs and other Unices, and giving up on openness. No thanks.

    --
    For every problem, there is at least one solution that is simple, neat, and wrong.
    1. Re:So this is the thing killing portability by olau · · Score: 4, Insightful

      You, sir, are a confused person. The protocol is open and free for any other OS to implement, and will remain so.

      If the BSDs are left in the dust, it's because they're lacking the manpower to do the things a new GUI needs. This was not a big problem for GNOME 2, which is architecturally more than a decade old. But things have changed.

      I can understand if people disagree with the path the GNOME developers have chosen because it does not fit with their ideals - but you have to understand that these developers are not your serfs you can command. There are still plenty of GUI environments with modest requirements of the OS, and while they may not do the same things you can choose from any of them as you wish. So quit the whining.

    2. Re:So this is the thing killing portability by Jah-Wren+Ryel · · Score: 3, Insightful

      you have to understand that these developers are not your serfs you can command

      Ugh, I hate that sort of extremist straw-man. The developers are working on public projects, that means they are subject to both public praise and public criticism. It is a package deal.

      --
      When information is power, privacy is freedom.
    3. Re:So this is the thing killing portability by Flammon · · Score: 4, Insightful

      There's already a D-Bus implementation available on BSD and other Unices. The API is documented and anyone has the freedom to implement it any way they want, userspace, kernelspace or outerspace.

      I fail to see how one more implementation, more specfically the Linux kernel one, has anything to do with giving up on anything.

  4. Re: "Slashmirrored" by SumDog · · Score: 4, Interesting

    My first experience with systemd was on OpenSUSE. Although it seems like a good idea, it seems to add some unneeded complexity. /etc/init.d/someservice restart now redirect to systemctl, with no real output. Oh I have to run status to see if it succeeded. Now I have to use journalctl to see why it failed.

    I'm all for dependency based init systems, but I feel Gentoo got that right with OpenRC. It gets rid of all that rc1,2,3,4,5 crap while keeping the /etc/init.d/ structure we're familiar with.

    Gentoo can not be setup to use systemd too. I guess it's now the future; better get use to it.

  5. Re: "Slashmirrored" by Desler · · Score: 4, Insightful

    Btw: Why is KDBUS code full with 'goto' calls ?

    For the same reason the kernel uses them. Because they aren't mindless ideologues.

  6. Re: "Slashmirrored" by sjames · · Score: 4, Insightful

    Actually, overall I would prefer sticking with /etc/rc[1-5]. It is simple and functional.

    All the new crap strikes me as some combination of fixing what's not broken and a solution desperately seeking a problem.

  7. Re: "Slashmirrored" by Sri+Ramkrishna · · Score: 3, Insightful

    You realize that a lot of systemd is supported by kernel developers. These things just don't get integrated by accident. The kernel has features, kernel devs want them used. If you want classic Unix, go head over to the BSD world.

  8. Re: "Slashmirrored" by modmans2ndcoming · · Score: 3, Insightful

    because RC[1-5] works so well with sleep and hibernate states on Laptops....oh wait....no it doesn't.

  9. Re: "Slashmirrored" by Desler · · Score: 5, Insightful

    Nope, it's because gotos are very nice for error handling over rats nests of if/else. Which is what its predominate use in the kernel is.

  10. Re: "Slashmirrored" by Anonymous Coward · · Score: 3, Insightful

    The unneeded complexity, moreover, does not befit a Unix. If you want one of those, you need to steer clear of most everything the freedesktop crowd, most notably mister Poettering, come up with. Otherwise, what you get is a sort of linux in windows-like sauce, compatible with nobody like a good little redmond product. If that's what you want, go for it. But software developed for this environment will no longer play well with other Unices. In fact, it is no longer a Unix, certainly not in spirit.

    Note that I'm not condemning this per se, but it does have far-reaching implications that honesty compels you to be aware of.

  11. Re: "Slashmirrored" by jcdr · · Score: 3, Insightful

    I am a user, an admin of a few systems, and an engineer of a numbers of systems.
    And I am really very happy by the KDBUS and systemd move.

    Not only there are technically good, but I hope that others concurrent projects will fork this common code base and start talking together what will be valuable to merge, instead of creating a yet another pointless unconnected project that will never gain enough audience to change anything but increasing the number of choice problems for a lot of distributions.

  12. Too much navel gazing by Sri+Ramkrishna · · Score: 5, Interesting
    Too much navel gazing about change. Here is the reason behind kdbus. Primarily it's for application sandboxing and making sure that a bad actor does not do something bad to something else. As GNU/Linux gets more popular, we want to be able to make sure that we can contain bad actors as much as possible. It's also a step in the direction to have a universal app spec instead of having to have each distro package the same damn app. I miean, how much duplicate work do you want to do? It makes it easier for people who write apps to have GNU/Linux as a target instead of having to pick the most popular distro at that point of time.

    http://lwn.net/Articles/551969/

    Linus is okay with it. Have to worry about Al Viro. :-)

    Here is an updated talk by Greg K-H that he gave on KDbus, he posted this about 3 days ago. https://github.com/gregkh/presentation-kdbus

    Let's stop all the FUD, and educate yourself on the reasons behind on this.

  13. Re:Listen to A.S.T. by Anonymous Coward · · Score: 3, Informative

    Andrew S. Tanenbaum had a point about Linux not being micro kernel.
    This is getting crazy: moving perfectly fine userland systems to the kernel.
    Isn't the kernel large enough already?

    That word does not mean what you think it means. In fact, kernel dbus is probably the most microkernel-ish feature I've seen added to the Linux kernel (although I haven't been paying close attention).

    A microkernel is defined as a kernel composed of a large number of very loosely coupled modules, with an absolute minimum of functionality in the modules that are loaded initially or by the bootloader. Because of this, microkernels tend to have slightly greater overhead (both processing and memory) than comparable monolithic kernels, while (ideally) making up for this in flexibility and ease of debugging. Modularity in ring 0 is a double-edged sword: there are few protections against screwing everything up in a monolithic system (although Linux is now more like a hybrid, with an emphasis on supporting both static and dynamic modules, and it's been decades since a single minor change in some static module has caused some unrelated module to do something silly like scribble all over my disk), but it's almost always easier and faster to write non-modular systems in ring 0 (particularly early in the process, when many of the basic facilities need to be implemented and debugged for the first time -- it's extremely difficult to debug module loading in a microkernel when something like printing messages to the screen are in a separate module). In a sense, the microkernel-vs-monolithic debate mirrors object orientation vs procedural programming debates of the past (and both are fairly moot -- it's a decision about which much ink and many pixels have been spilled, and in the end, the decision is one that probably should be based upon the requirements for the particular project. An atmel device with 500 bytes of ram doesn't need a microkernel; a system intended for something fairly exotic like transparent heterogenous distributed computing can benefit greatly from it).

    As for whether or not this is a good idea -- I'm in agreement that it's a bad idea, but primarily because of poor past experience with userland dbus implementations. I've used many distributions over the past fifteen years, and I've never had dbus work properly out of the box on any system that wasn't either debian-based or red hat based (and most of the distros I use on a regular basis are neither). If the developers working on top-10 distributions can't get it working properly and consistently and only the top two distributions can (for the sake of argument, I'm considering all debian-derivatives to be debian and all red hat derivatives to be red hat), then it's something that I don't trust to work in any kind of fringe situation, and it's not something I'd trust in kernel space except in the most well-tested situations (say, running a ten year old stable implementation on ten year old best-selling consumer hardware after five or six years of heavy automated testing). Much like some other systems being pushed by canonical (PulseAudio, systemd), dbus seems like it was released far too early and really isn't ready for prime time. Back in 2003, I'd expect and tolerate this kind of cavalier behavior from mainline distributions (remember Fedora Core 2's problems with ejecting CDs and then keeping them registered as mounted?), but Linux is now a perfectly reasonable desktop OS for most situations and enterprise-grade linux is big business, so shipping with completely broken non-solutions to already-solved problems (PulseAudio, which completely randomizes mixer settings on startup, etc.) seems unforgivably irresponsible.

  14. Re: "Slashmirrored" by chrylis · · Score: 3, Informative

    Pretty obvious typo for "can now be".

  15. Re: "Slashmirrored" by PlusFiveTroll · · Score: 4, Informative

    Even on fast SSDs I've never seen 8 cold boot it in 3 seconds. 9-12ish maybe. Add in windows networking and it's much slower. Also Windows delays a lot of tasks so you are to the GUI but your actual services are not running yet. In the server market your boot speed is highly dependent on network resource dependencies with varying delays.

  16. waking up requires special cases, so does moving by dutchwhizzman · · Score: 3, Interesting

    Modern systems often aren't a single purpose hardware server any more. Mobile devices that have to switch on services like GPS, several networking modems, voice over IP, hotplug hardware and start/stop associated services and such will make you have to run numerous daemons that control just restarting the one small group of services and hardware for every corner case you can imagine if you keep using RC scripts.

    Even servers often have nested dependencies these days. You'd want the system to restart a failing middleware application in the correct sequence after you've fixed the filesystem on the storage that ran out of space that caused it to remount r/o on all your web server platform VMs. Try doing a bunch of init.d scripts for that. Either you custom write a script to do it remotely just for your app, or you have the systemd-like control that will just figure out what to do all by itself.

    Yes, it adds complexity to very simple single use systems, but it makes dealing with all the glue you have to do to get dependencies on other services and corner cases so much easier. I used to think it was a solution looking for a problem too, until I found out that I could now stop worrying about getting my systems up again after I just solved the single cause of all the problems that got them down in the middle of the night.

    --
    I was promised a flying car. Where is my flying car?
  17. Re: "Slashmirrored" by Pseudonym · · Score: 3, Insightful

    C++ automatic stack unwinding is even nicer, but you can't have C++ in the kernel because mindless ideologues.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});