When user-session is done, systemd will send new system signal for user-session done.
interface=org.freedesktop.systemd1.Manager,member=UserSessionStartupFinished
UserSessionStartupFinished(t user_id)
Change-Id: I2ee9a2f232c22428894217fc2a519ec9c017fb2c
Signed-off-by: Woochang Kim <wchang.kim@samsung.com>
return sd_bus_send(bus, message, NULL);
}
+static int send_user_finished_to_system(sd_bus *bus, uid_t user_id) {
+ _cleanup_(sd_bus_message_unrefp) sd_bus_message *message = NULL;
+ int r;
+
+ assert(bus);
+
+ r = sd_bus_message_new_signal(bus, &message, "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "UserSessionStartupFinished");
+ if (r < 0)
+ return r;
+
+ r = sd_bus_message_append(message, "t", user_id);
+ if (r < 0)
+ return r;
+
+ return sd_bus_send(bus, message, NULL);
+}
+
+void bus_manager_send_user_finished_to_system(Manager *m, uid_t user_id)
+{
+ int r;
+
+ r = send_user_finished_to_system(m->system_bus, user_id);
+
+ if (r < 0)
+ log_debug_errno(r, "Failed to send user-session finished signal: %m");
+
+ return;
+}
+
void bus_manager_send_finished(
Manager *m,
usec_t firmware_usec,
extern const sd_bus_vtable bus_manager_vtable[];
+void bus_manager_send_user_finished_to_system(Manager *m, uid_t user_id);
void bus_manager_send_finished(Manager *m, usec_t firmware_usec, usec_t loader_usec, usec_t kernel_usec, usec_t initrd_usec, usec_t userspace_usec, usec_t total_usec);
void bus_manager_send_reloading(Manager *m, bool active);
void bus_manager_send_change_signal(Manager *m);
LOG_MESSAGE("Startup finished in %s.",
format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC)),
NULL);
+ bus_manager_send_user_finished_to_system(m, getuid());
}
bus_manager_send_finished(m, firmware_usec, loader_usec, kernel_usec, initrd_usec, userspace_usec, total_usec);