Using systemd-logind Session.TakeControl() from Xorg, input needed
Hans de Goede
hdegoede at redhat.com
Thu Dec 5 01:00:28 PST 2013
Hi All,
First of all thanks to everyone in this thread for the input.
Since a lot has been said in various mails I'm going to try
and summarize it all here, rather then sending a reply
to each and every mail in the thread.
It seems that the best and most feasible way to make Xorg
properly integrate with systemd-logind is to modify the
display manager (gdm for starters) to start a separate X
server per session as part of that session.
So for single user login first a gdm session gets created,
and then X gets started inside that session, and then on
login an user session gets created and another X gets
started inside the user session.
Downsides of this approach:
1) It will make it harder (but not impossible) to have
a smooth transition between login screen and the user
session
2) It may result in having 2 xservers running for a single
user login
Upsides:
1) It uses the new systemd-logind TakeControl interface as
designed, rather then trying to hack around it
2) It should allow the Xserver to be able to drop root
rights early on (it will still need them to create
the /tmp/.X11 sockets and log files)
3) This will make the way gdm start X and Wayland be more
or less the same, which should result in shared code-paths
I've been thinking about this for a bit now, and I am in
favor of following this approach myself.
So I'll mainly try to address the downsides here:
1) WRT making the smooth transition harder, this is something
which we need to get right for plymouth -> X, fast user
switching and wayland anyways, so I don't see this as causing
extra work, just as another reason to spend time on something
which we need to fix already anyways
2) WRT having 2 xservers running. xservers will run as part
of the session and on my current F20 system gdm already kills
the gdm session once you've logged in:
[hans at shalem ~]$ sudo gdbus call -y --dest org.freedesktop.login1 --object-path /org/freedesktop/login1 -m org.freedesktop.login1.Manager.ListSessions
([('1', uint32 500, 'hans', 'seat0', objectpath '/org/freedesktop/login1/session/_31')],)
Ray Strode also said: "You can't shut down an X server unless
it's in the foreground.". I can remember having done that
without problems just yesterday when working on systemd socket
activation for the xserver. I've just tried and I can happily
kill (normal kill not -9) Xorg :1 running on vt2 while I'm
inside a terminal on Xorg :0 running on vt1:
[ 3803.813] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 3840.021] (II) UnloadModule: "evdev"
[ 3840.021] (II) evdev: USB Mouse: Close
<lots more input devices closed>
[ 3840.023] (EE) Server terminated successfully (0). Closing log file.
Regards,
Hans
More information about the xorg-devel
mailing list