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 755760 - gvfs: add systemd user services corresponding to the D-Bus session services
gvfs: add systemd user services corresponding to the D-Bus session services
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
1.24.x
Other Linux
: Normal enhancement
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-28 20:13 UTC by Simon McVittie
Modified: 2015-10-12 18:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use conventional naming for D-Bus session services (4.45 KB, patch)
2015-09-28 20:13 UTC, Simon McVittie
none Details | Review
Add a corresponding systemd user service for every D-Bus session service (19.65 KB, patch)
2015-09-28 20:15 UTC, Simon McVittie
none Details | Review
Use conventional naming for D-Bus session services (4.58 KB, patch)
2015-09-29 20:04 UTC, Simon McVittie
accepted-commit_now Details | Review
Add a corresponding systemd user service for every D-Bus session service (19.65 KB, patch)
2015-09-29 20:04 UTC, Simon McVittie
accepted-commit_now Details | Review
[1.24-compatible] Add a corresponding systemd user service for every D-Bus session service (19.67 KB, patch)
2015-09-29 20:06 UTC, Simon McVittie
rejected Details | Review

Description Simon McVittie 2015-09-28 20:13:24 UTC
Similar to Bug #755740, it would be nice to put each session service in its own cgroup.
Comment 1 Simon McVittie 2015-09-28 20:13:57 UTC
Created attachment 312328 [details] [review]
Use conventional naming for D-Bus session services

This naming is mandatory for the system bus, but is also recommended
for the session bus.

The D-Bus maintainers recommend that all activatable session services'
service files are named according to the bus name, so that any conflict
is resolved in a deterministic way. If the services are in different
directories (precedence levels) the result is the same as it is now:
the higher precedence "wins". If the services are in the same
directory, either one overwrites the other and consistently "wins",
or a packaging system like dpkg prevents co-installation.

If the service files were named differently, it would be possible
to have two implementations for the same name. dbus-daemon resolves
this by choosing one arbitrarily, not necessarily the same one every
time. systemd's kdbus support is more strict (or less concerned with
backwards compatibility), and treats this situation as an error.
Comment 2 Simon McVittie 2015-09-28 20:15:08 UTC
Created attachment 312329 [details] [review]
Add a corresponding systemd user service for every D-Bus session  service

When using "systemd --user" in conjunction with "dbus-daemon --session
--systemd-activation", this ensures that each daemon is correctly placed
in its own cgroup, instead of being treated as part of dbus.service.

---

Depends on Attachment #312328 [details] (which is good to have anyway), to move the D-Bus services out of the way, so that the systemd services can take over the short names (which are conventional for systemd).
Comment 3 Simon McVittie 2015-09-28 20:19:38 UTC
(In reply to Simon McVittie from comment #2)
> Add a corresponding systemd user service for every D-Bus session  service

This is correct for 1.24.x (which I'm working against at the moment) but needs trivial adjustments for 1.26, because org.gtk.Private.* have been renamed to org.gtk.vfs.*.
Comment 4 Ondrej Holy 2015-09-29 12:13:36 UTC
Alex, can you look at please?
Comment 5 Simon McVittie 2015-09-29 12:27:17 UTC
Sorry, I don't currently have a GNOME 3.18 development environment, so there'll be a bit of a lead time before I can adjust the second patch for 1.26.

I think the first patch should be branch-independent.
Comment 6 Simon McVittie 2015-09-29 12:30:32 UTC
Review of attachment 312329 [details] [review]:

::: monitor/gdu/Makefile.am
@@ +56,2 @@
 clean-local:
 	rm -f *~ *.loT $(BUILT_SOURCES) $(service_DATA)

Philip Withnall points out that this clean-local rule can go away now that its contents are in CLEANFILES.

::: monitor/gphoto2/Makefile.am
@@ -86,1 @@
-EXTRA_DIST = hal-marshal.list $(service_in_files) gphoto2.monitor

Philip also pointed out that this incorrectly loses hal-marshal.list from EXTRA_DIST, which I need to fix.
Comment 7 Simon McVittie 2015-09-29 20:04:05 UTC
Created attachment 312371 [details] [review]
Use conventional naming for D-Bus session services

This naming is mandatory for the system bus, but is also recommended
for the session bus.

The D-Bus maintainers recommend that all activatable session services'
service files are named according to the bus name, so that any conflict
is resolved in a deterministic way. If the services are in different
directories (precedence levels) the result is the same as it is now:
the higher precedence "wins". If the services are in the same
directory, either one overwrites the other and consistently "wins",
or a packaging system like dpkg prevents co-installation.

If the service files were named differently, it would be possible
to have two implementations for the same name. dbus-daemon resolves
this by choosing one arbitrarily, not necessarily the same one every
time. systemd's kdbus support is more strict (or less concerned with
backwards compatibility), and treats this situation as an error.

---

Rebased on master (just after 1.26.0)
Comment 8 Simon McVittie 2015-09-29 20:04:37 UTC
Created attachment 312372 [details] [review]
Add a corresponding systemd user service for every D-Bus  session service

When using "systemd --user" in conjunction with "dbus-daemon --session
--systemd-activation", this ensures that each daemon is correctly placed
in its own cgroup, instead of being treated as part of dbus.service.

---

Rebased on master (just after 1.26.0)
Comment 9 Simon McVittie 2015-09-29 20:06:14 UTC
Created attachment 312373 [details] [review]
[1.24-compatible] Add a corresponding systemd user service for every D-Bus session service

---

Fixed version of the original 1.24-compatible patch, in case anyone wants that.
Comment 10 Philip Withnall 2015-09-30 07:23:36 UTC
All three patches now look good to me, for what it’s worth.
Comment 11 Alexander Larsson 2015-09-30 13:04:39 UTC
Review of attachment 312372 [details] [review]:

looks good to me
Comment 12 Alexander Larsson 2015-09-30 13:04:58 UTC
Review of attachment 312371 [details] [review]:

looks good to me
Comment 13 Ondrej Holy 2015-09-30 13:23:01 UTC
Pushed to master as commit 957fff5 and commit dc7040d. Thanks!
Comment 14 Simon McVittie 2015-09-30 13:30:02 UTC
Comment on attachment 312373 [details] [review]
[1.24-compatible] Add a corresponding systemd user service for every D-Bus session service

This one is unlikely to be merged; it's only here for people who might want to backport this feature. Marking as rejected.
Comment 15 Ondrej Holy 2015-10-12 18:38:46 UTC
Those patches break our test suite, following commit is needed to fix it:
commit ff92ef3aa4b09a648bd38152cc61ddfb99f41895