Blame SOURCES/0010-lib-retry-connecting-to-accountsservice-when-loading.patch

baf615
From 9b03e52b2504f215f960549c53bd4f617797dedd Mon Sep 17 00:00:00 2001
baf615
From: Ray Strode <rstrode@redhat.com>
baf615
Date: Tue, 3 Oct 2017 10:04:28 -0400
baf615
Subject: [PATCH 10/13] lib: retry connecting to accountsservice when loading
baf615
 users
baf615
baf615
If we were unable to connect to accountsservice and we need to
baf615
load users again, then try again.
baf615
---
baf615
 src/libaccountsservice/act-user-manager.c | 4 ++++
baf615
 1 file changed, 4 insertions(+)
baf615
baf615
diff --git a/src/libaccountsservice/act-user-manager.c b/src/libaccountsservice/act-user-manager.c
baf615
index 5ac157d..c8a0e20 100644
baf615
--- a/src/libaccountsservice/act-user-manager.c
baf615
+++ b/src/libaccountsservice/act-user-manager.c
baf615
@@ -2544,60 +2544,64 @@ load_console_kit_sessions (ActUserManager *manager)
baf615
                 g_debug ("ActUserManager: no seat proxy; can't load sessions");
baf615
                 return;
baf615
         }
baf615
 
baf615
         manager->priv->getting_sessions = TRUE;
baf615
         console_kit_seat_call_get_sessions (manager->priv->seat.seat_proxy,
baf615
                                             NULL,
baf615
                                             on_get_sessions_finished,
baf615
                                             g_object_ref (manager));
baf615
 }
baf615
 
baf615
 static void
baf615
 load_sessions (ActUserManager *manager)
baf615
 {
baf615
 #ifdef WITH_SYSTEMD
baf615
         if (LOGIND_RUNNING()) {
baf615
                 reload_systemd_sessions (manager);
baf615
                 maybe_set_is_loaded (manager);
baf615
                 return;
baf615
         }
baf615
 #endif
baf615
         load_console_kit_sessions (manager);
baf615
 }
baf615
 
baf615
 static void
baf615
 load_users (ActUserManager *manager)
baf615
 {
baf615
         g_assert (manager->priv->accounts_proxy != NULL);
baf615
         g_debug ("ActUserManager: calling 'ListCachedUsers'");
baf615
 
baf615
+        if (!ensure_accounts_proxy (manager)) {
baf615
+                return;
baf615
+        }
baf615
+
baf615
         accounts_accounts_call_list_cached_users (manager->priv->accounts_proxy,
baf615
                                                   NULL,
baf615
                                                   on_list_cached_users_finished,
baf615
                                                   g_object_ref (manager));
baf615
         manager->priv->listing_cached_users = TRUE;
baf615
 }
baf615
 
baf615
 static gboolean
baf615
 load_seat_incrementally (ActUserManager *manager)
baf615
 {
baf615
         manager->priv->seat.load_idle_id = 0;
baf615
 
baf615
         switch (manager->priv->seat.state) {
baf615
         case ACT_USER_MANAGER_SEAT_STATE_GET_SESSION_ID:
baf615
                 get_current_session_id (manager);
baf615
                 break;
baf615
         case ACT_USER_MANAGER_SEAT_STATE_GET_SESSION_PROXY:
baf615
                 get_session_proxy (manager);
baf615
                 break;
baf615
         case ACT_USER_MANAGER_SEAT_STATE_GET_ID:
baf615
                 get_seat_id_for_current_session (manager);
baf615
                 break;
baf615
         case ACT_USER_MANAGER_SEAT_STATE_GET_SEAT_PROXY:
baf615
                 get_seat_proxy (manager);
baf615
                 break;
baf615
         case ACT_USER_MANAGER_SEAT_STATE_LOADED:
baf615
                 g_debug ("ActUserManager: Seat loading sequence complete");
baf615
                 break;
baf615
         default:
baf615
                 g_assert_not_reached ();
baf615
-- 
baf615
2.14.1
baf615