[PATCH 2/2] systemd-logind: Only use systemd-logind integration together with keeptty

Hans de Goede hdegoede at redhat.com
Thu Apr 30 03:41:00 PDT 2015


Hi,

On 23-01-15 05:20, Peter Hutterer wrote:
> On Wed, Jan 21, 2015 at 10:36:16AM +0100, Hans de Goede wrote:
>> systemd-logind integration does not work when starting X on a new tty, as
>> that detaches X from the current session and after hat systemd-logind revokes
>> all rights any already open fds and refuses to open new fds for X.
>>
>> This means that currently e.g. "startx -- vt7" breaks, and breaks badly,
>> requiring ssh access to the system to kill X.
>>
>> The fix for this is easy, we must not use systemd-logind integration when
>> not using KeepTty, or iow we may only use systemd-logind integration together
>> with KeepTty.
>>
>> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
>> ---
>>   hw/xfree86/os-support/linux/systemd-logind.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
>> index 49758f4..b061877 100644
>> --- a/hw/xfree86/os-support/linux/systemd-logind.c
>> +++ b/hw/xfree86/os-support/linux/systemd-logind.c
>> @@ -34,6 +34,7 @@
>>
>>   #include "os.h"
>>   #include "dbus-core.h"
>> +#include "linux.h"
>>   #include "xf86.h"
>>   #include "xf86platformBus.h"
>>   #include "xf86Xinput.h"
>> @@ -595,6 +596,12 @@ static struct dbus_core_hook core_hook = {
>>   int
>>   systemd_logind_init(void)
>>   {
>> +    /* get vtno now as it may change keeptty */
>> +    linux_get_vtno();
>> +    /* systemd_logind integration requires keeptty */
>> +    if (!linux_get_keeptty())
>> +        return 1;
>> +
>
> I think this behaviour should be documented in the man page. And maybe even
> printf here that "-keeptty provided, disabling systemd-logind" as an Info.
> Otherwise there's too much quietly happening that's not obvious.
>
> with that, Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> for both

Will fix both for v2.

Regards,

Hans


More information about the xorg-devel mailing list