Blame SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch

3b7e70
From 5c52259331ce0b37dd1b2b092ff41f96b0e5ce64 Mon Sep 17 00:00:00 2001
890c66
From: Ray Strode <rstrode@redhat.com>
890c66
Date: Mon, 29 Oct 2018 06:57:59 -0400
890c66
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
890c66
 back to X
890c66
890c66
logind currently gets confused if a session is started immediately as
890c66
one is shutting down.
890c66
890c66
Workaround this problem by adding an artificial delay when falling
890c66
back to X.
890c66
890c66
http://bugzilla.redhat.com/1643874
890c66
---
3b7e70
 daemon/gdm-local-display-factory.c | 7 +++++++
3b7e70
 1 file changed, 7 insertions(+)
890c66
890c66
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
3b7e70
index 0bb3851f1..297c3ac80 100644
890c66
--- a/daemon/gdm-local-display-factory.c
890c66
+++ b/daemon/gdm-local-display-factory.c
3b7e70
@@ -586,60 +586,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
3b7e70
         preferred_display_server = get_preferred_display_server (factory);
890c66
 
3b7e70
         if (g_strcmp0 (preferred_display_server, "none") == 0) {
3b7e70
                g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display");
3b7e70
                return;
3b7e70
         }
3b7e70
 
3b7e70
         ret = sd_seat_can_graphical (seat_id);
890c66
 
3b7e70
         if (ret < 0) {
3b7e70
                 g_critical ("Failed to query CanGraphical information for seat %s", seat_id);
3b7e70
                 return;
3b7e70
         }
890c66
 
3b7e70
         if (ret == 0) {
3b7e70
                 g_debug ("GdmLocalDisplayFactory: System doesn't currently support graphics");
3b7e70
                 seat_supports_graphics = FALSE;
3b7e70
         } else {
3b7e70
                 g_debug ("GdmLocalDisplayFactory: System supports graphics");
3b7e70
                 seat_supports_graphics = TRUE;
3b7e70
         }
890c66
 
3b7e70
         if (g_strcmp0 (seat_id, "seat0") == 0) {
3b7e70
                 is_seat0 = TRUE;
3b7e70
 
3b7e70
                 falling_back = factory->num_failures > 0;
3b7e70
                 session_type = gdm_local_display_factory_get_session_type (factory, falling_back);
3b7e70
 
3b7e70
                 g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
3b7e70
                          session_type, falling_back? " fallback" : "");
890c66
+
3b7e70
+                if (falling_back) {
3b7e70
+			/* workaround logind race for now
3b7e70
+			 * bug 1643874
3b7e70
+			 */
3b7e70
+			g_usleep (2 * G_USEC_PER_SEC);
3b7e70
+                }
3b7e70
         } else {
3b7e70
                 is_seat0 = FALSE;
890c66
 
3b7e70
                 g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id);
3b7e70
                 /* Force legacy X11 for all auxiliary seats */
3b7e70
                 seat_supports_graphics = TRUE;
3b7e70
                 session_type = "x11";
890c66
         }
890c66
 
3b7e70
         /* For seat0, we have a fallback logic to still try starting it after
3b7e70
          * SEAT0_GRAPHICS_CHECK_TIMEOUT seconds. i.e. we simply continue even if
3b7e70
          * CanGraphical is unset.
3b7e70
          * This is ugly, but it means we'll come up eventually in some
3b7e70
          * scenarios where no master device is present.
3b7e70
          * Note that we'll force an X11 fallback even though there might be
3b7e70
          * cases where an wayland capable device is present and simply not marked as
3b7e70
          * master-of-seat. In these cases, this should likely be fixed in the
3b7e70
          * udev rules.
3b7e70
          *
3b7e70
          * At the moment, systemd always sets CanGraphical for non-seat0 seats.
3b7e70
          * This is because non-seat0 seats are defined by having master-of-seat
3b7e70
          * set. This means we can avoid the fallback check for non-seat0 seats,
3b7e70
          * which simplifies the code.
3b7e70
          */
3b7e70
         if (is_seat0) {
3b7e70
                 if (!seat_supports_graphics) {
3b7e70
                         if (!factory->seat0_graphics_check_timed_out) {
3b7e70
                                 if (factory->seat0_graphics_check_timeout_id == 0) {
3b7e70
                                         g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics.  Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT);
3b7e70
                                         factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT,
890c66
-- 
3b7e70
2.30.1
890c66