[git pull] Fix systemd integration when starting X on a new VT

Hans de Goede hdegoede at redhat.com
Wed Jun 3 10:50:04 PDT 2015


Hi,

On 03-06-15 16:02, Keith Packard wrote:
> Hans de Goede <hdegoede at redhat.com> writes:
>
>>         linux: Add linux_parse_vt_settings and linux_get_keeptty helpers
>>         linux: Add a may_fail paramter to linux_parse_vt_settings
>>         systemd-logind: Only use systemd-logind integration together with keeptty
>
> +Prevent the server from detaching its initial controlling terminal. If you
> +want to use systemd-logind integration you must specify this option.
> +Not all platforms support (or can use) this option.
>
> I'm sure you all discussed the various options for "fixing" this, but I
> see three options and I'd like to see some rational for the one you've
> picked
>
>   1) Make the missing -keeptty option to override the systemd logind
>      integration.

Right that is what this patch-set does.

>   2) Have systemd logind integration force -keeytty behaviour.

We actually already automatically enable -keepty when X is started
on the current vt, e.g. log into vt2, then run:
Xorg :1 vt2

And -keeptty is automatically enabled, that was part of the original
systemd integration set.

>   3) fix systemd to make the systemd/X integration work without the
>      -keeptty option?

The problem scenario we are trying to fix here is when the user does:

log into vt2, then run:
Xorg :1 vt7

So telling X to start on vt7, this will simply not work with logind,
since logind will only manage devices for us if we are part of a logind
managed session, and when starting on a new vt we automatically end
being part of the current session as linux will give the Xorg process
a new sid (session-id).

The only way to fix this would be for Xorg to register a new session
through pam, but that really is not the xserver-s job, but the job
of a session-manager like xdm or gdm.

Telling xorg to start on a different vt then the current one and
systemd-logind integration simply do not go together.

Yet people still want to start systemd-logind enabled Xorg builds on
a new vt for various reasons (mostly inertia I guess) and my goal
with introducing systemd-logind integration has always been to
not break _any_ existing use-cases. Hence this patch-set to
fix the start on new vt use-case by disabling systemd-logind
integration in this case.

Note that currently the behavior of:

log into vt2, then run:
Xorg :1 vt7

Is to exit with an error in the logs from the ddx driver that it
does not have drm master rights, as those are revoked on the logind
provided fd as soon as the xserver switches to the new vt.

I hope this clarifies things, and that with the above explanation
the chosen solution is acceptable.

Regards,

Hans


More information about the xorg-devel mailing list