[systemd-commits] src/login

Lennart Poettering lennart at kemper.freedesktop.org
Wed Jan 8 14:53:26 PST 2014


 src/login/logind-dbus.c         |   14 ++++++++++++++
 src/login/logind-session-dbus.c |    9 ++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit dd9b67aa3e9476b3a4b3e231006eea6d108c841f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jan 9 06:45:38 2014 +0800

    logind: wait for the user service to finish startup before completing login attempt

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 08510b5..2c86b9f 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1971,6 +1971,20 @@ int match_job_removed(sd_bus *bus, sd_bus_message *message, void *userdata, sd_b
                         user->slice_job = NULL;
                 }
 
+                LIST_FOREACH(sessions_by_user, session, user->sessions) {
+                        if (!session->started)
+                                continue;
+
+                        if (streq(result, "done"))
+                                session_send_create_reply(session, NULL);
+                        else {
+                                _cleanup_bus_error_free_ sd_bus_error e = SD_BUS_ERROR_NULL;
+
+                                sd_bus_error_setf(&e, BUS_ERROR_JOB_FAILED, "Start job for unit %s failed with '%s'", unit, result);
+                                session_send_create_reply(session, &e);
+                        }
+                }
+
                 user_save(user);
                 user_add_to_gc_queue(user);
         }
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index f1905e9..54ad827 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -647,13 +647,16 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
 
         assert(s);
 
-        /* This is called after the session scope was successfully
-         * created, and finishes where bus_manager_create_session()
-         * left off. */
+        /* This is called after the session scope and the user service
+         * were successfully created, and finishes where
+         * bus_manager_create_session() left off. */
 
         if (!s->create_message)
                 return 0;
 
+        if (!sd_bus_error_is_set(error) && (s->scope_job || s->user->service_job))
+                return 0;
+
         c = s->create_message;
         s->create_message = NULL;
 



More information about the systemd-commits mailing list