After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772370 - Split up .desktop target into multiple daemons
Split up .desktop target into multiple daemons
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks: 741688 772408 772447
 
 
Reported: 2016-10-03 16:02 UTC by Bastien Nocera
Modified: 2016-10-11 09:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: Remove ability to start/stop individual plugins (25.32 KB, patch)
2016-10-04 17:21 UTC, Bastien Nocera
reviewed Details | Review
main: Remove GSettings override for plugin priority (30.76 KB, patch)
2016-10-04 17:21 UTC, Bastien Nocera
reviewed Details | Review
plugins: Remove "test" from the stand-alone program names (24.79 KB, patch)
2016-10-04 17:21 UTC, Bastien Nocera
reviewed Details | Review
common: Add verbose option to test-plugin.h (1.49 KB, patch)
2016-10-04 17:21 UTC, Bastien Nocera
reviewed Details | Review
plugins: Rename sources of all test applications (23.10 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
sound: Rename the sound plugin for PulseAudio (1.12 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
plugins: Add desktop files for all the plugins (31.64 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
sharing: Add missing generated file to the daemon sources (745 bytes, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
plugins: Stop building helpers as plugins (87.87 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
main: Remove gnome-settings-daemon binary (47.38 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
data: Adapt pkg-config file for API removal (2.45 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
common: Remove use of SCHEMA_NAME (3.81 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
common: Report errors on startup in the helper skeleton (924 bytes, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
build: Add separate GTK+ skeleton (50.11 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
build: Remove separate check for gnome-desktop (1.47 KB, patch)
2016-10-04 17:22 UTC, Bastien Nocera
reviewed Details | Review
main: Remove gnome-settings-plugin.h (21.41 KB, patch)
2016-10-04 17:23 UTC, Bastien Nocera
reviewed Details | Review
plugins: Use LIBM macro instead of hard-coding it (4.21 KB, patch)
2016-10-04 17:23 UTC, Bastien Nocera
reviewed Details | Review
sharing: Install stand-alone gsd-sharing (716 bytes, patch)
2016-10-04 17:23 UTC, Bastien Nocera
reviewed Details | Review
power: Install stand-alone gsd-power (1.13 KB, patch)
2016-10-04 17:23 UTC, Bastien Nocera
reviewed Details | Review
common: Make daemons register with gnome-session (2.63 KB, patch)
2016-10-04 20:29 UTC, Bastien Nocera
none Details | Review
dummy: Add support for stub daemons (3.02 KB, patch)
2016-10-04 20:46 UTC, Bastien Nocera
none Details | Review
dummy: Add support for stub daemons (3.07 KB, patch)
2016-10-05 10:59 UTC, Bastien Nocera
reviewed Details | Review
common: Make daemons register with gnome-session (2.63 KB, patch)
2016-10-05 11:21 UTC, Bastien Nocera
reviewed Details | Review
common: Whitelist the plugins that should run under gdm (3.71 KB, patch)
2016-10-05 11:22 UTC, Bastien Nocera
reviewed Details | Review

Description Bastien Nocera 2016-10-03 16:02:49 UTC
Using patches from bug 741688 we could:
- build stand-alone daemons
- add .desktop files for every stand-alone daemons
- change the gnome-session definitions to add every one of those daemons[1]
- then remove the stand-alone daemon

[1]: do we need to re-add a dummy target for optional ones like the wacom tablet support?
Comment 1 Bastien Nocera 2016-10-04 17:21:41 UTC
Created attachment 336916 [details] [review]
main: Remove ability to start/stop individual plugins

All the plugins are now enabled by default, until we use another way to
start them individually.
Comment 2 Bastien Nocera 2016-10-04 17:21:46 UTC
Created attachment 336917 [details] [review]
main: Remove GSettings override for plugin priority

There's a default value already available in the plugin file itself.
Comment 3 Bastien Nocera 2016-10-04 17:21:51 UTC
Created attachment 336918 [details] [review]
plugins: Remove "test" from the stand-alone program names
Comment 4 Bastien Nocera 2016-10-04 17:21:56 UTC
Created attachment 336919 [details] [review]
common: Add verbose option to test-plugin.h
Comment 5 Bastien Nocera 2016-10-04 17:22:01 UTC
Created attachment 336920 [details] [review]
plugins: Rename sources of all test applications
Comment 6 Bastien Nocera 2016-10-04 17:22:06 UTC
Created attachment 336921 [details] [review]
sound: Rename the sound plugin for PulseAudio

org.gnome.SettingsDaemon.Sound not simply org.gnome.SettingsDaemon
Comment 7 Bastien Nocera 2016-10-04 17:22:12 UTC
Created attachment 336923 [details] [review]
plugins: Add desktop files for all the plugins

So that the plugins can be started independently.
Comment 8 Bastien Nocera 2016-10-04 17:22:17 UTC
Created attachment 336924 [details] [review]
sharing: Add missing generated file to the daemon sources
Comment 9 Bastien Nocera 2016-10-04 17:22:23 UTC
Created attachment 336925 [details] [review]
plugins: Stop building helpers as plugins
Comment 10 Bastien Nocera 2016-10-04 17:22:28 UTC
Created attachment 336926 [details] [review]
main: Remove gnome-settings-daemon binary
Comment 11 Bastien Nocera 2016-10-04 17:22:34 UTC
Created attachment 336927 [details] [review]
data: Adapt pkg-config file for API removal

We don't have an API anymore, plugins are now stand-alone daemons, but
we still need to install enumeration headers.
Comment 12 Bastien Nocera 2016-10-04 17:22:39 UTC
Created attachment 336928 [details] [review]
common: Remove use of SCHEMA_NAME
Comment 13 Bastien Nocera 2016-10-04 17:22:44 UTC
Created attachment 336929 [details] [review]
common: Report errors on startup in the helper skeleton
Comment 14 Bastien Nocera 2016-10-04 17:22:50 UTC
Created attachment 336930 [details] [review]
build: Add separate GTK+ skeleton

And simplify library requirements for each helper. This should allow
us to trim the number of dependencies for each one of the helpers. This
also moves the libnotify initialisation directly into the plugins that
need it.
Comment 15 Bastien Nocera 2016-10-04 17:22:55 UTC
Created attachment 336931 [details] [review]
build: Remove separate check for gnome-desktop
Comment 16 Bastien Nocera 2016-10-04 17:23:00 UTC
Created attachment 336932 [details] [review]
main: Remove gnome-settings-plugin.h

The plugin system is not used any more, and wasn't dist'ed, which broke
building from tarballs.
Comment 17 Bastien Nocera 2016-10-04 17:23:05 UTC
Created attachment 336933 [details] [review]
plugins: Use LIBM macro instead of hard-coding it

And fix gsd-color linkage by the same token.
Comment 18 Bastien Nocera 2016-10-04 17:23:10 UTC
Created attachment 336934 [details] [review]
sharing: Install stand-alone gsd-sharing
Comment 19 Bastien Nocera 2016-10-04 17:23:16 UTC
Created attachment 336935 [details] [review]
power: Install stand-alone gsd-power
Comment 20 Bastien Nocera 2016-10-04 17:57:48 UTC
This nearly works. It's missing some code to register with gnome-session, and using the dummy plugin to launch fake daemons for the non-Linux cases (to replace the Wacom plugin mentioned in the gnome-session session file).
Comment 21 Bastien Nocera 2016-10-04 20:29:22 UTC
Created attachment 336949 [details] [review]
common: Make daemons register with gnome-session
Comment 22 Bastien Nocera 2016-10-04 20:46:26 UTC
Created attachment 336952 [details] [review]
dummy: Add support for stub daemons

So that gnome-session can keep a list of hard-coded gsd daemons for now,
we'll need to replace some of the daemons with dummy ones.

For each of the daemons that can be disabled, create a .desktop file
anyway, and launch a gsd-dummy.
Comment 23 Bastien Nocera 2016-10-04 20:52:18 UTC
Ray, this is ready to go as far as I'm concerned. I tested it by building RPMs on my machine, and I can start sessions without a problem. Power management and media keys work.

This requires the single line patch I made to gnome-session. The only thing blocking it right now is: how do we get gdm to only start the daemons it needs?
Comment 24 Ray Strode [halfline] 2016-10-04 21:06:17 UTC
So maybe the plugins themselves should check the session class of the logind session and disable or degrade ? I think Allison always thought we should go that way over the whitelists anyway.
Comment 25 Bastien Nocera 2016-10-04 22:18:14 UTC
(In reply to Ray Strode [halfline] from comment #24)
> So maybe the plugins themselves should check the session class of the logind
> session and disable or degrade ? I think Allison always thought we should go
> that way over the whitelists anyway.

How would I get the session class? When we move to systemd, it might be better to avoid running the daemons altogether. In the meantime, they'll need to stay running as stubs.
Comment 26 Bastien Nocera 2016-10-05 10:59:27 UTC
Created attachment 336975 [details] [review]
dummy: Add support for stub daemons

So that gnome-session can keep a list of hard-coded gsd daemons for now,
we'll need to replace some of the daemons with dummy ones.

For each of the daemons that can be disabled, create a .desktop file
anyway, and launch a gsd-dummy.
Comment 27 Bastien Nocera 2016-10-05 11:21:17 UTC
Created attachment 336977 [details] [review]
common: Make daemons register with gnome-session
Comment 28 Bastien Nocera 2016-10-05 11:22:30 UTC
Created attachment 336978 [details] [review]
common: Whitelist the plugins that should run under gdm

As we don't have a way to restrict which plugins get enabled from the
gdm side, do it ourselves.
Comment 29 Bastien Nocera 2016-10-05 11:29:51 UTC
This should do it. Please test and report. I'll commit all this tomorrow after testing if I don't get negative feedback.
Comment 30 Ray Strode [halfline] 2016-10-05 20:36:32 UTC
Review of attachment 336978 [details] [review]:

::: plugins/common/daemon-skeleton-gtk.h
@@ +55,3 @@
+	guint i;
+
+	session_mode = g_getenv ("GNOME_SHELL_SESSION_MODE");

This is probably fine, but I think it would be better to blacklist certain plugins if sd_session_get_class() returns anything but "user".

One complication is knowing what session to pass, gnome-settings-daemon itself isn't running in a session anymore, so you can't use the current session. You have to iterate over the available sessions for the user and hope there's only one graphical one I guess. Of course this all sort of falls over with multi-seat.

Probably what you're doing is the easiest answer for now.
Comment 31 Ray Strode [halfline] 2016-10-05 20:37:22 UTC
Review of attachment 336916 [details] [review]:

okay but this should probably go in after the gdm detection to black list certain ones
Comment 32 Ray Strode [halfline] 2016-10-05 20:38:00 UTC
Review of attachment 336917 [details] [review]:

++
Comment 33 Ray Strode [halfline] 2016-10-05 20:38:38 UTC
Review of attachment 336918 [details] [review]:

maybe just add in the description "This is going to be the primary way they are started now".
Comment 34 Ray Strode [halfline] 2016-10-05 20:39:23 UTC
Review of attachment 336919 [details] [review]:

++
Comment 35 Ray Strode [halfline] 2016-10-05 20:41:13 UTC
Review of attachment 336920 [details] [review]:

feels like this commit should come before the commit that adds verbose. or maybe the commit that adds --verbose should come before the commit that renamed the binaries.
Comment 36 Ray Strode [halfline] 2016-10-05 20:41:58 UTC
Review of attachment 336921 [details] [review]:

ok
Comment 37 Ray Strode [halfline] 2016-10-05 20:42:43 UTC
Review of attachment 336923 [details] [review]:

so the days desktop files are supposed to follow reverse dns notation.
Comment 38 Ray Strode [halfline] 2016-10-05 20:43:26 UTC
Review of attachment 336924 [details] [review]:

ok
Comment 39 Ray Strode [halfline] 2016-10-05 20:44:44 UTC
Review of attachment 336925 [details] [review]:

nice, and mitosis is complete
Comment 40 Ray Strode [halfline] 2016-10-05 20:45:32 UTC
Review of attachment 336926 [details] [review]:

++
Comment 41 Ray Strode [halfline] 2016-10-05 20:49:22 UTC
Review of attachment 336927 [details] [review]:

maybe we should ultimately move them to gsettings-desktop-schemas or something so you can drop the file entirely.
Comment 42 Ray Strode [halfline] 2016-10-05 20:51:28 UTC
Review of attachment 336928 [details] [review]:

this should maybe be earlier in the set.
Comment 43 Ray Strode [halfline] 2016-10-05 20:52:43 UTC
Review of attachment 336929 [details] [review]:

++
Comment 44 Ray Strode [halfline] 2016-10-05 20:59:14 UTC
Review of attachment 336930 [details] [review]:

nice cleanup.

::: configure.ac
@@ +73,3 @@
 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
 
+AC_CHECK_LIBM

interesting, didn't know about that.

::: plugins/common/daemon-skeleton-gtk.h
@@ +19,3 @@
+
+#ifndef PLUGIN_NAME
+#error Include PLUGIN_CFLAGS in the test application s CFLAGS

probably shouldn't have the word test here (but i guess it should get stripped from the file this was clone from before this file gets cloned)

::: plugins/common/daemon-skeleton.h
@@ +44,2 @@
+        context = g_option_context_new (NULL);
+        g_option_context_add_main_entries (context, *(&entries), GETTEXT_PACKAGE);

*(&entries) is weird, just put entries (unless i'm missing something?)
Comment 45 Ray Strode [halfline] 2016-10-05 20:59:34 UTC
Review of attachment 336931 [details] [review]:

yay
Comment 46 Ray Strode [halfline] 2016-10-05 21:00:42 UTC
Review of attachment 336932 [details] [review]:

maybe squash this with the "stop building helpers as plugins" commit?
Comment 47 Ray Strode [halfline] 2016-10-05 21:01:55 UTC
Review of attachment 336933 [details] [review]:

makes sense to me, though could do all the LIBM stuff up front before doing any of the modularization work I guess.
Comment 48 Ray Strode [halfline] 2016-10-05 21:03:29 UTC
Review of attachment 336934 [details] [review]:

should definitely be before the commit that adds the desktop file.
Comment 49 Ray Strode [halfline] 2016-10-05 21:03:54 UTC
Review of attachment 336935 [details] [review]:

also should be before the commit that adds the desktop file
Comment 50 Giovanni Campagna 2016-10-05 21:06:08 UTC
(In reply to Ray Strode [halfline] from comment #30)
> Review of attachment 336978 [details] [review] [review]:
> 
> ::: plugins/common/daemon-skeleton-gtk.h
> @@ +55,3 @@
> +	guint i;
> +
> +	session_mode = g_getenv ("GNOME_SHELL_SESSION_MODE");
> 
> This is probably fine, but I think it would be better to blacklist certain
> plugins if sd_session_get_class() returns anything but "user".
> 
> One complication is knowing what session to pass, gnome-settings-daemon
> itself isn't running in a session anymore, so you can't use the current
> session. You have to iterate over the available sessions for the user and
> hope there's only one graphical one I guess. Of course this all sort of
> falls over with multi-seat.
> 
> Probably what you're doing is the easiest answer for now.

Isn't it easier to have a gdm.session file in gnome-session (or in gdm itself), and then let gdm start gnome-session with the right --session argument?
Comment 51 Ray Strode [halfline] 2016-10-05 21:11:16 UTC
Review of attachment 336975 [details] [review]:

ugh. if we just let these guys get dbus activated the first time they're queried by gnome-shell or whatever would things start malfunctioning?
Comment 52 Ray Strode [halfline] 2016-10-05 21:14:52 UTC
Review of attachment 336977 [details] [review]:

ok
Comment 53 Bastien Nocera 2016-10-06 17:50:25 UTC
(In reply to Ray Strode [halfline] from comment #30)
> Review of attachment 336978 [details] [review] [review]:
> 
> ::: plugins/common/daemon-skeleton-gtk.h
> @@ +55,3 @@
> +	guint i;
> +
> +	session_mode = g_getenv ("GNOME_SHELL_SESSION_MODE");
> 
> This is probably fine, but I think it would be better to blacklist certain
> plugins if sd_session_get_class() returns anything but "user".
> 
> One complication is knowing what session to pass, gnome-settings-daemon
> itself isn't running in a session anymore, so you can't use the current
> session. You have to iterate over the available sessions for the user and
> hope there's only one graphical one I guess. Of course this all sort of
> falls over with multi-seat.
> 
> Probably what you're doing is the easiest answer for now.

I'll make a note that we should change this, but it would add a library dependency on libsystemd, which is probably not something we want to do for now.

(In reply to Ray Strode [halfline] from comment #33)
> Review of attachment 336918 [details] [review] [review]:
> 
> maybe just add in the description "This is going to be the primary way they
> are started now".

Done.

(In reply to Ray Strode [halfline] from comment #37)
> Review of attachment 336923 [details] [review] [review]:
> 
> so the days desktop files are supposed to follow reverse dns notation.

Done.

(In reply to Ray Strode [halfline] from comment #41)
> Review of attachment 336927 [details] [review] [review]:
> 
> maybe we should ultimately move them to gsettings-desktop-schemas or
> something so you can drop the file entirely.

Maybe, but most of those relate to settings that are in g-s-d itself. This is used by gnome-control-center and I think dconf/dconf-editor.

Will do the rest tomorrow. (I'm at comment 44 right now).
Comment 54 Bastien Nocera 2016-10-07 10:23:04 UTC
(In reply to Ray Strode [halfline] from comment #44)
> ::: plugins/common/daemon-skeleton-gtk.h
> @@ +19,3 @@
> +
> +#ifndef PLUGIN_NAME
> +#error Include PLUGIN_CFLAGS in the test application s CFLAGS
> 
> probably shouldn't have the word test here (but i guess it should get
> stripped from the file this was clone from before this file gets cloned)

Fixed.

> ::: plugins/common/daemon-skeleton.h
> @@ +44,2 @@
> +        context = g_option_context_new (NULL);
> +        g_option_context_add_main_entries (context, *(&entries),
> GETTEXT_PACKAGE);
> 
> *(&entries) is weird, just put entries (unless i'm missing something?)

Fixed

(In reply to Ray Strode [halfline] from comment #48)
> Review of attachment 336934 [details] [review] [review]:
> 
> should definitely be before the commit that adds the desktop file.

Done.

(In reply to Ray Strode [halfline] from comment #49)
> Review of attachment 336935 [details] [review] [review]:
> 
> also should be before the commit that adds the desktop file

Done.
Comment 55 Bastien Nocera 2016-10-07 11:58:47 UTC
I didn't do any commits reordering, as rebasing is really costly in time. I however made sure that distcheck worked after every single commit.

Out to fix a couple of bugs now.
Comment 56 Bastien Nocera 2016-10-11 09:35:07 UTC
Newer versions merged and released in 3.23.2.