[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH xinit v3 3/3] startx: Under Linux start X on the current VT
From:       Hans de Goede <hdegoede () redhat ! com>
Date:       2014-03-31 13:51:46
Message-ID: 1396273906-4596-4-git-send-email-hdegoede () redhat ! com
[Download RAW message or body]

When we let X allocate a new VT, systemd-logind will not recognize any
processes running on this VT as belonging to a valid session (since there
was no pam session opened on that tty).

This causes problems like PolicyKit denials for these processes.

ConsoleKit under Linux has been deprecated for a few years now and is no
longer being maintained, so simply make this the default under Linux.

Note we do not pass in the vt if the user has specified an alternative server
to start, as the vtX argument is only valid for the Xorg server, likewise we
omit it if the user has specified any other server arguments.

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=806491

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 startx.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/startx.cpp b/startx.cpp
index b7a29f9..f4a0283 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -187,6 +187,17 @@ XCOMM process server arguments
 if [ x"$server" = x ]; then
     server=$defaultserver
 
+#ifdef __linux__
+    XCOMM When starting the defaultserver start X on the current tty to avoid
+    XCOMM the startx session being seen as inactive:
+    XCOMM https://bugzilla.redhat.com/show_bug.cgi?id=806491
+    tty=$(tty)
+    if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then
+        tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
+        defaultserverargs=${defaultserverargs}" vt"${tty_num}
+    fi
+#endif
+
     XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments
     if [ x"$serverargs" = x -a x"$display" = x ]; then
 	if [ -f "$userserverrc" ]; then
-- 
1.9.0

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic