summaryrefslogtreecommitdiff
path: root/src/login/logind-dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-09 06:45:38 +0800
committerLennart Poettering <lennart@poettering.net>2014-01-09 06:51:09 +0800
commitdd9b67aa3e9476b3a4b3e231006eea6d108c841f (patch)
treeefcaf687b195ad798d95a86da546d96bec6619d6 /src/login/logind-dbus.c
parentf37925e02f562d0f705be29ec31b0053ce6f7afa (diff)
logind: wait for the user service to finish startup before completing login attempt
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r--src/login/logind-dbus.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 08510b5ecc..2c86b9fa26 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);
}