diff options
author | Benjamin Berg <bberg@redhat.com> | 2019-04-20 00:39:15 +0200 |
---|---|---|
committer | Benjamin Berg <benjamin@sipsolutions.net> | 2019-08-05 21:47:38 +0000 |
commit | 50eccb08910419ca8a0f085bd547b38203ab4492 (patch) | |
tree | 420c60931127d985a2c59404f788d726a80f95fa /plugins/media-keys | |
parent | 65253003cd54b066e1d0c8c89a4b7ee6225555f1 (diff) | |
download | gnome-settings-daemon-50eccb08910419ca8a0f085bd547b38203ab4492.tar.gz |
plugins: Add systemd user service files for all the plugins
Using the facility added in the previous commit, we can add systemd user
service files for all plugins and know when they have started up.
This is roughly based on the work previously done by Iain Lane
<iain@orangesquash.org.uk> and Bastien Nocera hadess@hadess.net>.
For each g-s-d process we have a service and a target file. This
separation only exists to contain dependency failures which would cause
an OnFailure action to trigger and is needed so that we can use
OnFailure for the gnome-session fail-whale
(gnome-session-failed.target).
In general, the approach taken is that we start g-s-d processes after
gnome-session-initialized.target and before gnome-session.target.
We want to be able to selectively start the services only when one or
more dependencies are there, or even mask out services under some
conditions. The approach taken is the following:
* To mask a service, use a Conflicts entry. This is e.g. used to not
start certain services in GDM using
Conflicts=gnome-session@gnome-login.target
* To depend on multiple targets to be up and running to start, we set
each of these targets in Requisite/After/PartOf/WantedBy. We always
do this for gnome-session-initialized.target but this method is
extensible to any number of further targets (e.g. bluetooth.target)
Diffstat (limited to 'plugins/media-keys')
-rw-r--r-- | plugins/media-keys/gsd-media-keys.service.in | 18 | ||||
-rw-r--r-- | plugins/media-keys/gsd-media-keys.target.in | 10 | ||||
-rw-r--r-- | plugins/media-keys/org.gnome.SettingsDaemon.MediaKeys.desktop.in | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/plugins/media-keys/gsd-media-keys.service.in b/plugins/media-keys/gsd-media-keys.service.in new file mode 100644 index 00000000..0b715b6b --- /dev/null +++ b/plugins/media-keys/gsd-media-keys.service.in @@ -0,0 +1,18 @@ +[Unit] +Description=GNOME Media keys handling +# Note that we do the shenanigans with having a target and a service solely +# so that OnFailure is not called in case of a dependency failure. +# See also https://github.com/systemd/systemd/issues/12352 +OnFailure=gnome-session-failed.target +CollectMode=inactive-or-failed +RefuseManualStart=true +RefuseManualStop=true + +PartOf=gsd-media-keys.target +After=gnome-session-initialized.target + +[Service] +Type=dbus +ExecStart=@libexecdir@/gsd-media-keys +Restart=on-failure +BusName=@plugin_dbus_name@ diff --git a/plugins/media-keys/gsd-media-keys.target.in b/plugins/media-keys/gsd-media-keys.target.in new file mode 100644 index 00000000..519738bb --- /dev/null +++ b/plugins/media-keys/gsd-media-keys.target.in @@ -0,0 +1,10 @@ +[Unit] +Description=GNOME Media keys handling + +BindsTo=gsd-media-keys.service +After=gsd-media-keys.service + +Requisite=gnome-session-initialized.target +After=gnome-session-initialized.target +PartOf=gnome-session-initialized.target +Before=gnome-session.target diff --git a/plugins/media-keys/org.gnome.SettingsDaemon.MediaKeys.desktop.in b/plugins/media-keys/org.gnome.SettingsDaemon.MediaKeys.desktop.in index de53c3f1..58f4cf4e 100644 --- a/plugins/media-keys/org.gnome.SettingsDaemon.MediaKeys.desktop.in +++ b/plugins/media-keys/org.gnome.SettingsDaemon.MediaKeys.desktop.in @@ -7,3 +7,4 @@ NoDisplay=true X-GNOME-Autostart-Phase=Initialization X-GNOME-Autostart-Notify=true X-GNOME-AutoRestart=true +X-GNOME-HiddenUnderSystemd=@systemd_hidden@ |