Notify service startup to systemd
Using the bus name to notify service startup to systemd has some disadvantages. The main one being that systemd will consider a gnome-shell restart (Alt+F2 r) a service failure and restart the shell, cleaning up all its children (i.e. user launched applications). In the future the shell should launch applications in their own transient unit so that a service restart does not affect applications. Another potential issue is that we must never load gnome-shell-wayland.service and gnome-shell-x11.service at the same time, as systemd does not like two services providing the same bus name. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1496 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/690
This commit is contained in:

committed by
Florian Müllner

parent
da6c154ceb
commit
cf156b469c
@ -24,6 +24,14 @@
|
||||
#include "shell-perf-log.h"
|
||||
#include "st.h"
|
||||
|
||||
#ifdef HAVE_SYSTEMD
|
||||
#include <systemd/sd-daemon.h>
|
||||
#else
|
||||
/* So we don't need to add ifdef's everywhere */
|
||||
#define sd_notify(u, m) do {} while (0)
|
||||
#define sd_notifyf(u, m, ...) do {} while (0)
|
||||
#endif
|
||||
|
||||
extern GType gnome_shell_plugin_get_type (void);
|
||||
|
||||
#define SHELL_DBUS_SERVICE "org.gnome.Shell"
|
||||
@ -524,6 +532,7 @@ main (int argc, char **argv)
|
||||
shell_init_debug (g_getenv ("SHELL_DEBUG"));
|
||||
|
||||
shell_dbus_init (meta_get_replace_current_wm ());
|
||||
sd_notify (0, "READY=1");
|
||||
shell_a11y_init ();
|
||||
shell_perf_log_init ();
|
||||
shell_introspection_init ();
|
||||
|
Reference in New Issue
Block a user