[systemd-devel] Create a new logind session from a systemd --user unit

Colin Walters walters at verbum.org
Sun Aug 4 07:46:44 PDT 2013

On Tue, 2013-07-30 at 01:02 +0200, Lennart Poettering wrote:

> We are working on this bit by bit. If you want this to go faster, then
> please work with us, and write patches for libX11 and D-Bus.

Ok, some hacking on the plane on the way to GUADEC got me really far on
this; then we had a quick face to face to work through some conceptual

In the new user@ model, it's very important to note there is only one
"stub" process per session (at least graphical ones - whether we change
getty is a whole other topic).  So for graphical, everything is launched
from user at .service.  The side effect of this is twofold:

1) Pretty much all the user processes are no longer inside a session
   at all.
2) It is now much harder to log in multiple times graphically; this
   is kind of a crazy thing to do, but it's still *possible*.  To do
   so, you wire up your userspace code to set
   the pile of usual environment variables to override (DISPLAY,
   DBUS_SESSION_BUS_ADDRESS, etc.)  I can say though at least for
   GNOME we haven't supported this for years, so it's really not
   a change.

For for adapting to 1), we agreed on adding the concept of a "primary"
session, which is basically the first non-tty login.  I've added a small
API to systemd to look this up, and the patched GNOME to use it
(although we partially still respect XDG_SESSION_ID).

My current patches are here:


I've been hacking on it using gnome-ostree; if there's interest I can
toss up a VM.

Before I spend too much time polishing the patches, I'd like to be sure
the high level architecture makes sense.  So please take a look at the
patches at that level; I'll split them up cleanly with better commit
messages after.

Obligatory screenshot:

More information about the systemd-devel mailing list