DevHeads.net

systemd and KDE (was: Re: kdeinit)

On Sun, Aug 21, 2011 at 4:54 PM, John Layt < ... at kde dot org> wrote:
During Desktop Summit, I've jumped on the systemd-KDE-integration
bandwagon (which seems to be only me at the moment, or is there any
work which I'm not aware of?).

As a very first step, there's libqsystemd [1], which I'll try to
finish and polish in the next few weeks. This should make it easy to
write apps that communicate with systemd. For example, what about a
proper Plasma dataengine for systemd units/jobs and an applet that
e.g. shows the state of a systemd unit? There's an proof-of-concept
dataengine in the repo [1], but the subject is in need of someone who
knows his way around Plasma dataengines and friends.

The second integration point is the unified interfaces for system
configuration that systemd provides. If systemd is present, it should
be used to set (possibly also get) the hostname, locale, and system
time. Also, KDM should be able to communicate with systemd-logind,
which (as outlined by Lennart's talk at DS) seeks to replace
ConsoleKit.

The third integration point is to use systemd as a session manager,
thereby (as already mentioned) possibly replacing big parts of our own
startup sequence. Once I can get a current version of systemd to
compile on my machine, I will try to look into this, but of course
help is appreciated on all fronts.

Greetings
Stefan

[1] git clone kde:libqsystemd

Comments

Re: systemd and KDE (was: Re: kdeinit)

By Jaroslav Reznik at 09/14/2011 - 03:41

Yes, it is - maybe something I can help internally but can't promise
anything as you know Lennart but we're now in position we have to go
through our internal needs for systemd.

Stefan,
thanks for stepping in. Some time ago I just tried systemd password
agent, I have to check if you implement it, otherwise it would be
great to have it in one place.

But back to systemd and KDE integration. Is there something we can
be helpful? Especially regarding the problems in systemd you rushed
into etc.?

Yes, these last two things are important for us. Usually we (Fedora) are
hit first :( And we're just really small team but we're trying at least :)
(PolicyKit, uDisk/uPower integration etc.)

So if you can include me and Lukas Tinkl in further discussion/development
it would be great.

Thanks,
Jaroslav

Re: systemd and KDE (was: Re: kdeinit)

By John Tapsell at 09/14/2011 - 04:13

Regarding integration - for a long time I've been interested in adding
support to System Activity (ctrl+esc thingy). In Windows, the task
manager has a tab for both processes and for services, and you can
switch between the two. So you can right click on a process and jump
to its service, and vice versa. This integration makes a lot of sense
since its often better to stop the service than to just kill the
process.

I've been somewhat waiting for the fight between upstart and systemd
to be resolved, and also it would be good to have the following DBUS
calls available to non-root users:

1) Return a list of currently running / stopped / runnable / etc services
2) Provide user-friendly information about each service. (Short
description that I can show to the user)
3) Provide a list of PIDs for a given service
4) Return the service for a given PID

Can these calls be added if necessary please?

JohnFlux

Re: systemd and KDE (was: Re: kdeinit)

By Tom Gundersen at 09/14/2011 - 08:11

On Wed, Sep 14, 2011 at 11:13 AM, John Tapsell < ... at gmail dot com> wrote:
These two are available.

I couldn't see this, but maybe I missed it. At least you can get the
cgroup, and then you can look in the "procs" file to get a list of
pids belonging to the group.

This is available.

Cheers,

Tom

Re: systemd and KDE (was: Re: kdeinit)

By Stefan Majewsky at 09/14/2011 - 15:04

On Wed, Sep 14, 2011 at 3:11 PM, Tom Gundersen < ... at jklm dot no> wrote:
I think you should be fine with traversing the cgroup hierarchy.
Without having read it, the code of systemd-cgls should tell you
everything you need. As for getting this information from systemd via
D-Bus, systemd only allows the
org.freedesktop.systemd1.Manager.ListUnits method to be called by
non-root. I remember that I wanted to ask Lennart about this, but it
seems I never came around to doing it. Will do that now.

Greetings
Stefan

Re: systemd and KDE (was: Re: kdeinit)

By Aaron J. Seigo at 08/23/2011 - 01:10

On Sunday, August 21, 2011 17:59:33 Stefan Majewsky wrote:
once the unitAdded/unitRemoved signals are added to QsdManager, then those can
easily be hooked up in the engine.

is there a way to get notified from systemd when a unit changes activation or
load state? because those would also be useful in the engine, obviously.

with those in place, there really isn't much more needed in the engine: there
are no dynamic sources (they are all push-published by systemd; so no
sourceRequestEvent implementation is needed) and polling makes no sense (so
updateSourceEvent is unecessary to implement)

the only thing that might be interesting is to provide a serviceForSource
implementation that allows interacting with a unit, if a user is able to do
anything useful (such as activate/deactive a unit?). i'm not sure that's
possible though; if not then a Service is also unecessary.

Re: systemd and KDE (was: Re: kdeinit)

By Stefan Majewsky at 08/23/2011 - 09:48

On Tue, Aug 23, 2011 at 8:10 AM, Aaron J. Seigo < ... at kde dot org> wrote:
I don't see such signals, and this can be a real problem. libqsystemd
currently implements caching for values because I consider D-Bus calls
expensive, but there is nothing that would invalidate cached values.

That's possible, though the default setup of the D-Bus service grants
this right only to root. Sounds like a job for PolicyKit.

Greetings
Stefan

Re: systemd and KDE (was: Re: kdeinit)

By Tom Gundersen at 08/23/2011 - 10:18

On Tue, Aug 23, 2011 at 4:48 PM, Stefan Majewsky
<stefan. ... at googlemail dot com> wrote:
You might have a look at how "systemctl --privileged" (man
says:"--privileged: Acquire privileges via PolicyKit before executing
the operation.")

-t

Re: systemd and KDE (was: Re: kdeinit)

By Stefan Majewsky at 08/23/2011 - 09:51

On Tue, Aug 23, 2011 at 4:48 PM, Stefan Majewsky
<stefan. ... at googlemail dot com> wrote:
Looked again, and there is a single change signal, plus a set of
properties which are invalidated by this signal. Should be enough to
keep the cache sane.

Greetings
Stefan

Re: systemd and KDE (was: Re: kdeinit)

By Tom Gundersen at 08/21/2011 - 12:51

On Sun, Aug 21, 2011 at 5:59 PM, Stefan Majewsky
<stefan. ... at googlemail dot com> wrote:
Feel free to drop by #systemd if you are having trouble with compiling
/ dependencies (I'm tomegun). Alternatively, Arch Linux ships the
latest version of systemd in our community repositories.

Cheers,

Tom