Proof of concept systemd dataengine for Plasma

August 11, 2011

What you see here is the very first steps towards systemd integration in Qt. I’ve started to build a libqsystemd, which wraps systemd’s DBus API into something which can be used by Qt applications. The screenshot shows a simple QML-based Plasma applet reading information about available systemd units from a simple dataengine.

At the moment, the library can only list available units, providing about 60% of the info which you would get from `systemctl list-units`. But adding more functions should be trivial now that the foundations are laid.

The only interesting point left is how different privilege levels will be handled. For example, only root may activate and deactivate units, initiate system shutdown etc. Most properties are even read-protected from normal users.

Of course, providing a library interface is only the first step for systemd integration with KDE. The second step is to actually use it. For example, systemd provides standard interfaces for setting the hostname, timezone, etc. in a desktop-independent manner. systemd can in the future also be used to coordinate the startup of a KDE session, and thus replace parts of startkde and kdeinit.

About these ads

11 Responses to “Proof of concept systemd dataengine for Plasma”

  1. Eric Mesa Says:

    That’s awesome. I’m sure the Fedora/Red Hat engr team will appreciate it! I can’t wait to see how it makes KDE work better on my home Fedora machine.

    • Stefan Majewsky Says:

      Actually that work was prompted by my discussions with Lennart and Kay at the Desktop Summit.

  2. bash Says:

    thanks, great news! But build fails for me:

    • Stefan Majewsky Says:

      Um.. that looks like your checkout is broken. Why should it try to launch the executable “python2python2″, when the first line of src/” clearly says “python2″ only?

      • bash Says:

        yep, sorry the output in my terminal was worng.
        I tried again and then I got:
        /usr/bin/env python2: No such file or directory

        I installed python2, and now I get:

        • Stefan Majewsky Says:

          Hm, that’s probably because new methods have been added to systemd’s DBus interface in later versions. I’m using systemd 18 at the moment (released January 2011; the current version is 33, which won’t build here because of an outdated udev version).

          So at the moment, there’s not much I can do about this until I can get a current version of systemd up and running here.

  3. Alb Says:

    please, just don’t forget of systems out there without systemd (i.e., don’t make it *required*, thus breaking the compatibility of kde with non-linux systems) ;)

    your friendly neighborhood freebsd/kde developer

  4. jrdls Says:

    Wow! Thanks! I’ve been waiting for something like this since lennart posted his Rethinking PID 1 blog entry. I even created an entry in brainstorm though this goes beyond what I had in mind at the time. Replacing parts of kdeinit sounds interesting. Would systemd become the parent process of every kde app started?

    • Stefan Majewsky Says:

      systemd is already the parent of any process, because the process hierarchy starts/ends at PID 1.

      Actually, the systemd project aims to extend its process management to the user session, by giving each application started by the user its own cgroup. “Application” will, in this meaning, correspond to a desktop file. So for example if you launch Chromium, it will get its own cgroup, where you can also find all the processes it launches for the separate browser tabs. And if you want to kill Chromium, you can kill the cgroup and be sure that all browser tabs and Flash player instances and what not are gone too.

      All of this is still far away, though, but that’s like the plan.

  5. kokekai Says:

    Is there any plans to have systemd as an alternative to ConsoleKit in KDE?

    • Stefan Majewsky Says:

      ConsoleKit will probably see no further development on Linux, so for Linux it’s definitely the right choice to move to systemd. Don’t know what will happen on BSD and the other *nixes, though.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.