Support systemd

Bug #930488 reported by Robert Ancell on 2012-02-11
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Light Display Manager

Bug Description

We need to support LightDM running in systemd. I don't know what this requires.

Related branches

Changed in lightdm:
status: New → Triaged
importance: Undecided → Low
Damjan Georgievski (gdamjan) wrote :

Also see comment #3 on this bug

Robert Ancell (robert-ancell) wrote :

One particular task that is quite simple is to make liblightdm use logind if it is present. Currently the shutdown/restart methods fail to work in a systemd OS.

Kirill Elagin (kirelagin) wrote :

Well, according to LightDM already as everything it needs to work with systemd-logind instead of ConsoleKit.

Seems that it is sufficient to add a configure option to simply disable all ConsoleKit-related logic.

Changed in lightdm:
importance: Low → Medium
Martin Bříza (mbriza) wrote :

There is some relevant information on this topic in the following links: - a thread on LightDM mailing list with my questions and answers - KDE doesn't cooperate right with LightDM and systemd-logind, report for Fedora - LightDM lacks systemd support, report for Fedora

Martin Bříza (mbriza) wrote :

With systemd, no /sbin/login is spawned when a manual switch to an other VT is initiated.
Once again, a black screen appears. Don't know yet where the problem is.
BUT the switching problem is not related to systemd - it's a bug in LightDM.

Xristh (prflr) wrote :

At same time I compille the 1.4.0 without consolekit presence on systemd with and in the greeter (lightdm-gtk-greeter) I give a valid path to the backgound and the background remain black
install conslekit and recompille with consolekit presence fix, but remove consolekit posteriori to lightdm REcompilation make the bkack screen again


Xristh (prflr) wrote :

Fedora guid created a patch for systemd-logind support

probably any of yours guys want give a watch

Martin Bříza (mbriza) wrote :

Xristh: Yes, this patch was sent to the mailing list by its author:

Regarding issues reported by me - the no login prompt spawning issue was not related to LightDM at all.
Unreliable tracking of switched users is a bug that affects LightDM regardless of what underlying session management system is used. I sent a patch for this to the list, too:
Robert Ancell thinks, it's this bug:

There will possibly be more (and more complicated) problems with systemd support but the basic functionality is fine with the patches, in my opinion. By this, I mean multi-seat support as listed on .

Peter de Ridder (cavalier) wrote :

This patch added systemd-logind support for locking and unlocking sessions.
Opening sessions is handled by systemd and PAM. This uses open session to get the session path, which can later be used for locking and unlocking.

This patch does not include multi seat. It includes "Minimal porting" as described on

Robert Ancell (robert-ancell) wrote :

Hi Peter,

Thanks for that! Can you submit this as a merge proposal [1] and if possible add some tests like the console kit ones for it?

I'm not going to block on the above and I'll do those steps if you can't but that's the preferred process.

Thanks again!

[1] If you're not familiar with bzr the following works:
$ bzr branch lp:lightdm
$ (make changes)
$ bzr commit -m "Add logind support" --fixes lp:930488
$ bzr push lp:~cavalier/lightdm/logind-support
Go to and click "Propose for merging"

Peter de Ridder (cavalier) wrote :

Hi Robert,

I tried adding the tests, but that is a bit more tricky than ConsoleKit.
Normally the systemd-logind session is opened by PAM. This means that lightdm doesn't open the session. Instead it uses GetSessionByPID.
For the test this means that test applications needs to verify if this is the right PID, whereas the ConsoleKit sends the x11-display as parameter.
Any suggestions on how to handle this?

For the test application, should this implement the whole systemd-logind DBus api, or only the calls that are currently made from lightdm?


Robert Ancell (robert-ancell) wrote :

Hi Peter,

You'll have to record the PID in tests/src/libsystem.c by writing a file somewhere then read this file from tests/src/test-runner.c when the D-Bus interface is called. Only do this if it's important that GetSessionByPID needs to check it was passed the correct PID, otherwise just always return a session. You only need to implement the API that lightdm calls.

Guido Berhoerster (gber) wrote :

Could you also incorporate the patch from bug 1152185 in order to get rid of the runtime dependency on ConsoleKit for shutdown/reboot as well?

Iain Lane (laney) wrote :

I started working on this too, then found the patch in this bug so switched my work over to incorporating this patch in a bzr branch. It's at lp:~laney/lightdm/logind but I'm happy to have it in any shared location. I'll try to work on the tests too.

I add some defines and a configure flag to enable/disable consolekit/logind. It's not strictly necessary though and could be removed if people would prefer to just do runtime detection.

Peter de Ridder (cavalier) wrote :

I just pushed the test to lp~/cavalier/lightdm/logind-support, but they don't effectively check for anything are there is no session cookie to check, like with ConsoleKit.

I can add the patch from bug 1152185 too, I'm not sure how the policy is with mixing patches in a branch.

@Lain: I don't mind if you want to continue on systemd support. I just want to get it in there. I'm willing to assist if necessary.
I didn't add configuration for ConsoleKit/systemd as it only interfaces with dbus and intentionally didn't use the systemd API. It is fine to add these options as long as run time detection is also available, this will beneficial to distributions in transition.

Robert Ancell (robert-ancell) wrote :

I've just committed bug 1152185 which adds support for shutdown/reboot from liblightdm. This has some tests and implements some of the logind D-Bus interface in test-runner. Sorry, you'll have to merge the new functionality/tests with this.

Iain Lane (laney) wrote :

In lp:~laney/lightdm/logind I've merged trunk and reworked the tests. The new power tests seem to fail and I'll look at why on Monday unless someone else gets to it. I got rid of the conditionals and just build logind and CK support all the time, with logind preferred.

We should probably unify naming to use "logind" or "login1". Currently we use both.

Robert Ancell (robert-ancell) wrote :

My preference is to use login1 over logind since potentially we will also have to support a login2 in the future.

Iain Lane (laney) wrote :

Righto. login1 it is. Seems to ~work from what I can see. MP incoming.

Robert Ancell (robert-ancell) wrote :

From duplicate bug 1017126 graysky notes that we should also add the following to /etc/pam.d/lightdm:

session optional"

PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:lightdm at revision 1651, scheduled for release in lightdm, milestone Unknown

Changed in lightdm:
status: Triaged → Fix Committed
Changed in lightdm:
status: Fix Committed → Fix Released
milestone: none → 1.7.0
affects: lightdm (Arch Linux) → gdm
Changed in gdm:
importance: Undecided → Unknown
status: New → Unknown
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.