79 lines
2.8 KiB
Diff
79 lines
2.8 KiB
Diff
From 816c85d0e8fc517db3382bce4a94bc5d859b3eca Mon Sep 17 00:00:00 2001
|
|
From: Hans de Goede <hdegoede@redhat.com>
|
|
Date: Wed, 21 Jan 2015 10:13:20 +0100
|
|
Subject: [PATCH v2 3/3] systemd-logind: Only use systemd-logind integration
|
|
together with keeptty
|
|
|
|
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@redhat.com>
|
|
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
---
|
|
Changes in v2:
|
|
-Document that -keeptty must be passed for logind integration in man page
|
|
-Print an INFO message when disabling logind integration due to -keeptty
|
|
not being set
|
|
Changes in v3:
|
|
-Fix typo in manpage additions
|
|
-Use new may_fail parameter to linux_parse_vt_settings
|
|
---
|
|
hw/xfree86/man/Xorg.man | 6 +++---
|
|
hw/xfree86/os-support/linux/systemd-logind.c | 8 ++++++++
|
|
2 files changed, 11 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
|
|
index 3ff6aef..ddf1358 100644
|
|
--- a/hw/xfree86/man/Xorg.man
|
|
+++ b/hw/xfree86/man/Xorg.man
|
|
@@ -271,9 +271,9 @@ is ignored if
|
|
is anything other than \(oqPCI\(cq.
|
|
.TP 8
|
|
.B \-keeptty
|
|
-Prevent the server from detaching its initial controlling terminal.
|
|
-This option is only useful when debugging the server. Not all platforms
|
|
-support (or can use) this option.
|
|
+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.
|
|
.TP 8
|
|
.BI \-keyboard " keyboard-name"
|
|
Use the xorg.conf(__filemansuffix__) file
|
|
diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
|
|
index 4ad41a3..69e2f67 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"
|
|
@@ -596,6 +597,13 @@ static struct dbus_core_hook core_hook = {
|
|
int
|
|
systemd_logind_init(void)
|
|
{
|
|
+ if (linux_parse_vt_settings(TRUE) && !linux_get_keeptty()) {
|
|
+ LogMessage(X_INFO,
|
|
+ "systemd-logind: logind integration requires -keeptty and "
|
|
+ "-keeptty was not provided, disabling logind integration\n");
|
|
+ return 1;
|
|
+ }
|
|
+
|
|
return dbus_core_add_hook(&core_hook);
|
|
}
|
|
|
|
--
|
|
2.4.0
|
|
|