[gnome-shell/benzea/systemd-user-units: 4/7] data: Use new systemd unit layout
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/benzea/systemd-user-units: 4/7] data: Use new systemd unit layout
- Date: Fri, 26 Apr 2019 10:07:35 +0000 (UTC)
commit 960edffc0059270277c5972335202cbbced07aca
Author: Benjamin Berg <bberg redhat com>
Date: Sat Apr 20 00:21:55 2019 +0200
data: Use new systemd unit layout
The existing units were never used as the corresponding support was
never merged. The new design does not currently use multiple separate
targets for wayland and Xorg sessions.
Note that this will likely change further in gnome-session and
gnome-shell should make use of this to modify the restart behaviour on
wayland.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507
data/gnome-shell-wayland.target | 5 -----
data/gnome-shell-x11.target | 5 -----
data/gnome-shell.service.in | 27 +++++++++++++++++++++++----
data/gnome-shell.target | 8 ++++++++
data/meson.build | 3 +--
5 files changed, 32 insertions(+), 16 deletions(-)
---
diff --git a/data/gnome-shell.service.in b/data/gnome-shell.service.in
index ee275fa0e..4e141a70d 100644
--- a/data/gnome-shell.service.in
+++ b/data/gnome-shell.service.in
@@ -1,11 +1,30 @@
[Unit]
Description=GNOME Shell
-Wants=gnome-session.service
-After=graphical-session-pre.target gnome-session-bus.target
-PartOf=graphical-session.target
+RefuseManualStart=true
+
+Requisite=gnome-session-manager.target
+After=gnome-session-manager.target
+
+Requisite=gnome-session-initialized.target
+Before=gnome-session-initialized.target
+PartOf=gnome-session-initialized.target
+
+Before=gnome-session.target
+
+# Limit startup frequency (see comment below)
+StartLimitIntervalSec=15s
+StartLimitBurst=1
[Service]
Type=dbus
ExecStart=@bindir@/gnome-shell
-Restart=on-failure
+# XXX: On X11 we want to restart on-success (Alt+F2 + r) and on-failure
+# while on wayland we cannot restart properly.
+# Maybe a good approach would be to disable extensions if the shell
+# fails in the first minute or so after logon. i.e. we define a
+# gnome-session-stable.target which is reached after a timeout (simple
+# unit that sleeps) and Requisite on that in the disable handler.
+Restart=always
+# Do not wait 100ms and limit restarting more than usual
+RestartSec=0ms
BusName=org.gnome.Shell
diff --git a/data/gnome-shell.target b/data/gnome-shell.target
new file mode 100644
index 000000000..3bdd466b5
--- /dev/null
+++ b/data/gnome-shell.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=GNOME Shell
+DefaultDependencies=false
+
+BindsTo=gnome-shell.service
+After=gnome-shell.service
+
+Wants=gnome-shell-extensions-disabled-warning.service
diff --git a/data/meson.build b/data/meson.build
index 50d00da2e..96beca222 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -107,8 +107,7 @@ if have_systemd
install_dir: systemd_userunitdir
)
- units = files('gnome-shell-wayland.target',
- 'gnome-shell-x11.target')
+ units = files('gnome-shell.target')
install_data(units, install_dir: systemd_userunitdir)
endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]