Commit 97d1cf53 authored by Ray Strode's avatar Ray Strode
Browse files

manager: restart user bus if last graphical session

There are desktop services (such as goa-daemon, e-d-s, etc)
that don't open the display, but rely on dbus-daemon to scope
the session. These days dbus-daemon is a user bus, not a sesssion,
bus which leaves these services alive after log out.

This commit checks to see if we're the last desktop session for the
user at log out time, and if so, restarts the dbus daemon. This
will lead to existing clients getting booted and die, but allow user
bus clients that want to outlive a session to stick around if they so

Longer term, clients should stop relying on the session bus to define
their lifetime.
parent 1dd8905d
......@@ -935,6 +935,40 @@ _client_stop (const char *id,
return FALSE;
static void
maybe_restart_user_bus (GsmManager *manager)
GsmSystem *system;
g_autoptr(GVariant) reply = NULL;
g_autoptr(GError) error = NULL;
if (manager->priv->dbus_disconnected)
system = gsm_get_system ();
if (!gsm_system_is_last_session_for_user (system))
reply = g_dbus_connection_call_sync (manager->priv->connection,
g_variant_new ("(ss)", "dbus.service", "replace"),
if (error != NULL) {
g_debug ("GsmManager: reloading user bus failed: %s", error->message);
static void
do_phase_exit (GsmManager *manager)
......@@ -944,6 +978,10 @@ do_phase_exit (GsmManager *manager)
maybe_restart_user_bus (manager);
end_phase (manager);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment