[gnome-shell/benzea/systemd-3.36-units: 12/12] data: Add an abstract gnome-shell.target



commit e9bce3bbe876a20157cef937a2f9c550fa21d340
Author: Benjamin Berg <bberg redhat com>
Date:   Tue Dec 10 16:23:43 2019 +0100

    data: Add an abstract gnome-shell.target
    
    Add a gnome-shell.target to simplify pulling in the GNOME shell into the
    ssession. Also, the intermediate targets are not very helpful after all.
    We can instead use "Conflicts" (but not "Requires") to ensure the right
    service is loaded on wayland/X11.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/895

 data/gnome-shell-wayland.service.in |  4 ++--
 data/gnome-shell-wayland.target     | 10 ----------
 data/gnome-shell-x11.service.in     |  4 ++--
 data/gnome-shell-x11.target         | 10 ----------
 data/gnome-shell.target             | 18 ++++++++++++++++++
 data/meson.build                    |  3 +--
 6 files changed, 23 insertions(+), 26 deletions(-)
---
diff --git a/data/gnome-shell-wayland.service.in b/data/gnome-shell-wayland.service.in
index 04f94af2d6..cbf470bee1 100644
--- a/data/gnome-shell-wayland.service.in
+++ b/data/gnome-shell-wayland.service.in
@@ -13,8 +13,8 @@ Requisite=gnome-session-initialized.target
 PartOf=gnome-session-initialized.target
 Before=gnome-session-initialized.target
 
-# The units already conflict because they use the same BusName
-#Conflicts=gnome-shell-x11.service
+# Do not load in X11 session
+Conflicts=gnome-session-x11.target
 
 [Service]
 Type=notify
diff --git a/data/gnome-shell-x11.service.in b/data/gnome-shell-x11.service.in
index a10c33d29d..374b47ddc2 100644
--- a/data/gnome-shell-x11.service.in
+++ b/data/gnome-shell-x11.service.in
@@ -13,8 +13,8 @@ Requisite=gnome-session-initialized.target
 PartOf=gnome-session-initialized.target
 Before=gnome-session-initialized.target
 
-# The units already conflict because they use the same BusName
-#Conflicts=gnome-shell-wayland.service
+# Do not load in wayland session
+Conflicts=gnome-session-wayland.target
 
 # Limit startup frequency more than the default
 StartLimitIntervalSec=15s
diff --git a/data/gnome-shell.target b/data/gnome-shell.target
new file mode 100644
index 0000000000..d1f69ada4a
--- /dev/null
+++ b/data/gnome-shell.target
@@ -0,0 +1,18 @@
+[Unit]
+Description=GNOME Shell
+DefaultDependencies=no
+CollectMode=inactive-or-failed
+
+Requisite=gnome-session-initialized.target
+PartOf=gnome-session-initialized.target
+Before=gnome-session-initialized.target
+
+# Pull in both x11 and wayland, one of them will fail due to dependencies.
+Wants=gnome-shell-wayland.service
+Wants=gnome-shell-x11.service
+
+PartOf=gnome-shell-wayland.service
+PartOf=gnome-shell-x11.service
+
+After=gnome-shell-wayland.service
+After=gnome-shell-x11.service
diff --git a/data/meson.build b/data/meson.build
index 88a61765f5..acd0af1f56 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -114,8 +114,7 @@ if have_systemd
     install_dir: systemduserunitdir
   )
 
-  units = files('gnome-shell-x11.target',
-                'gnome-shell-wayland.target',
+  units = files('gnome-shell.target',
                 'gnome-shell-disable-extensions.service')
 
   install_data(units, install_dir: systemduserunitdir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]