2021-11-09 10:00:59 +00:00
|
|
|
From 874b26e3674d540df37d7f145df853bcf81e5a26 Mon Sep 17 00:00:00 2001
|
2020-04-28 09:35:31 +00:00
|
|
|
From: Ray Strode <rstrode@redhat.com>
|
|
|
|
Date: Wed, 5 Feb 2020 15:20:48 -0500
|
2021-11-09 10:00:59 +00:00
|
|
|
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats
|
2020-04-28 09:35:31 +00:00
|
|
|
|
|
|
|
GNOME doesn't deal very well with multiple sessions
|
|
|
|
running on a multiple seats at the moment.
|
|
|
|
|
|
|
|
Until that's fixed, ensure sessions run on auxillary
|
|
|
|
seats get their own session bus.
|
|
|
|
---
|
2021-11-09 10:00:59 +00:00
|
|
|
daemon/gdm-session.c | 11 ++++++++++-
|
|
|
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
2020-04-28 09:35:31 +00:00
|
|
|
|
|
|
|
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
2021-11-09 10:00:59 +00:00
|
|
|
index 418240dc0..77d6b8ff0 100644
|
2020-04-28 09:35:31 +00:00
|
|
|
--- a/daemon/gdm-session.c
|
|
|
|
+++ b/daemon/gdm-session.c
|
2021-11-09 10:00:59 +00:00
|
|
|
@@ -2822,119 +2822,128 @@ on_start_program_cb (GdmDBusWorker *worker,
|
2020-04-28 09:35:31 +00:00
|
|
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
|
|
|
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
self = conversation->session;
|
|
|
|
service_name = conversation->service_name;
|
|
|
|
|
|
|
|
if (worked) {
|
2021-11-09 10:00:59 +00:00
|
|
|
self->session_pid = pid;
|
|
|
|
self->session_conversation = conversation;
|
2020-04-28 09:35:31 +00:00
|
|
|
|
|
|
|
g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
|
|
|
|
g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
|
|
|
|
} else {
|
|
|
|
gdm_session_stop_conversation (self, service_name);
|
|
|
|
|
|
|
|
g_debug ("GdmSession: Emitting 'session-start-failed' signal");
|
|
|
|
g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gdm_session_start_session (GdmSession *self,
|
|
|
|
const char *service_name)
|
|
|
|
{
|
|
|
|
GdmSessionConversation *conversation;
|
|
|
|
GdmSessionDisplayMode display_mode;
|
|
|
|
gboolean is_x11 = TRUE;
|
|
|
|
gboolean run_launcher = FALSE;
|
|
|
|
gboolean allow_remote_connections = FALSE;
|
|
|
|
+ gboolean run_separate_bus = FALSE;
|
|
|
|
char *command;
|
|
|
|
char *program;
|
2021-11-09 10:00:59 +00:00
|
|
|
gboolean register_session;
|
2020-04-28 09:35:31 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GDM_IS_SESSION (self));
|
2021-11-09 10:00:59 +00:00
|
|
|
g_return_if_fail (self->session_conversation == NULL);
|
2020-04-28 09:35:31 +00:00
|
|
|
|
|
|
|
conversation = find_conversation_by_name (self, service_name);
|
|
|
|
|
|
|
|
if (conversation == NULL) {
|
|
|
|
g_warning ("GdmSession: Tried to start session of "
|
|
|
|
"nonexistent conversation %s", service_name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
stop_all_other_conversations (self, conversation, FALSE);
|
|
|
|
|
|
|
|
display_mode = gdm_session_get_display_mode (self);
|
|
|
|
|
|
|
|
#ifdef ENABLE_WAYLAND_SUPPORT
|
2021-11-09 10:00:59 +00:00
|
|
|
is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
|
2020-04-28 09:35:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
|
|
|
|
display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
|
|
|
|
run_launcher = TRUE;
|
|
|
|
}
|
|
|
|
|
2021-11-09 10:00:59 +00:00
|
|
|
register_session = !gdm_session_session_registers (self);
|
|
|
|
|
|
|
|
+ if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
|
2020-04-28 09:35:31 +00:00
|
|
|
+ run_separate_bus = TRUE;
|
|
|
|
+ }
|
|
|
|
+
|
2021-11-09 10:00:59 +00:00
|
|
|
if (self->selected_program == NULL) {
|
2020-04-28 09:35:31 +00:00
|
|
|
gboolean run_xsession_script;
|
|
|
|
|
|
|
|
command = get_session_command (self);
|
|
|
|
|
|
|
|
run_xsession_script = !gdm_session_bypasses_xsession (self);
|
|
|
|
|
2021-11-09 10:00:59 +00:00
|
|
|
if (self->display_is_local) {
|
2020-04-28 09:35:31 +00:00
|
|
|
gboolean disallow_tcp = TRUE;
|
|
|
|
gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
|
|
|
|
allow_remote_connections = !disallow_tcp;
|
|
|
|
} else {
|
|
|
|
allow_remote_connections = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (run_launcher) {
|
|
|
|
if (is_x11) {
|
2021-11-09 10:00:59 +00:00
|
|
|
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
|
|
|
|
register_session ? "--register-session " : "",
|
2020-04-28 09:35:31 +00:00
|
|
|
run_xsession_script? "--run-script " : "",
|
|
|
|
allow_remote_connections? "--allow-remote-connections " : "",
|
|
|
|
command);
|
|
|
|
} else {
|
2021-11-09 10:00:59 +00:00
|
|
|
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
|
|
|
|
register_session ? "--register-session " : "",
|
2020-04-28 09:35:31 +00:00
|
|
|
command);
|
|
|
|
}
|
|
|
|
} else if (run_xsession_script) {
|
|
|
|
- program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
2021-11-09 10:00:59 +00:00
|
|
|
+ if (run_separate_bus) {
|
|
|
|
+ program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
|
|
|
|
+ } else {
|
|
|
|
+ program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
|
|
|
|
+ }
|
2020-04-28 09:35:31 +00:00
|
|
|
} else {
|
|
|
|
program = g_strdup (command);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (command);
|
|
|
|
} else {
|
2021-11-09 10:00:59 +00:00
|
|
|
/* FIXME:
|
|
|
|
* Always use a separate DBus bus for each greeter session.
|
|
|
|
* Firstly, this means that if we run multiple greeter session
|
|
|
|
* (which we really should not do, but have to currently), then
|
|
|
|
* each one will get its own DBus session bus.
|
|
|
|
* But, we also explicitly do this for seat0, because that way
|
|
|
|
* it cannot make use of systemd to run the GNOME session. This
|
|
|
|
* prevents the session lookup logic from getting confused.
|
|
|
|
* This has a similar effect as passing --builtin to gnome-session.
|
|
|
|
*
|
|
|
|
* We really should not be doing this. But the fix is to use
|
|
|
|
* separate dynamically created users and that requires some
|
|
|
|
* major refactorings.
|
|
|
|
*/
|
2020-04-28 09:35:31 +00:00
|
|
|
if (run_launcher) {
|
|
|
|
if (is_x11) {
|
2021-11-09 10:00:59 +00:00
|
|
|
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
|
|
|
|
register_session ? "--register-session " : "",
|
|
|
|
self->selected_program);
|
2020-04-28 09:35:31 +00:00
|
|
|
} else {
|
2021-11-09 10:00:59 +00:00
|
|
|
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
|
|
|
|
register_session ? "--register-session " : "",
|
|
|
|
self->selected_program);
|
2020-04-28 09:35:31 +00:00
|
|
|
}
|
|
|
|
--
|
2021-11-09 10:00:59 +00:00
|
|
|
2.30.1
|
2020-04-28 09:35:31 +00:00
|
|
|
|