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 766176 - gnome-session: update activation environment at startup
gnome-session: update activation environment at startup
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
: 766819 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-05-09 14:03 UTC by Ray Strode [halfline]
Modified: 2016-07-12 02:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnome-session: update activation environment at startup (1.27 KB, patch)
2016-05-09 14:03 UTC, Ray Strode [halfline]
committed Details | Review
gnome-session: move update-activation-environment call down (1.05 KB, patch)
2016-05-09 15:14 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2016-05-09 14:03:07 UTC
The dbus daemon gets started before some environment variables
are set at start up.

This commit makes sure the dbus daemon is given a clean snapshot
of the environment at the time the session is started.

This is a near-term workaround for

https://github.com/alexlarsson/xdg-app/issues/147

and will probably go away when we figure out a story for bug 736660
Comment 1 Ray Strode [halfline] 2016-05-09 14:03:24 UTC
Created attachment 327521 [details] [review]
gnome-session: update activation environment at startup
Comment 2 Ray Strode [halfline] 2016-05-09 14:04:13 UTC
Attachment 327521 [details] pushed as d14f6db - gnome-session: update activation environment at startup
Comment 3 Ray Strode [halfline] 2016-05-09 15:14:22 UTC
Created attachment 327526 [details] [review]
gnome-session: move update-activation-environment call down

I had a think-o and where it should be placed in the script.
Comment 4 Ray Strode [halfline] 2016-05-09 15:15:05 UTC
Comment on attachment 327526 [details] [review]
gnome-session: move update-activation-environment call down

Attachment 327526 [details] pushed as d8184cf - gnome-session: move update-activation-environment call down
Comment 5 Laurent Bigonville 2016-05-24 11:18:29 UTC
Shouldn't this patch also be backported to the 3.20 branch?
Comment 6 Laurent Bigonville 2016-05-24 11:18:39 UTC
*** Bug 766819 has been marked as a duplicate of this bug. ***
Comment 7 Laurent Bigonville 2016-05-24 12:10:01 UTC
Also, shouldn't --systemd also be passed to dbus-update-activation-environment ?
Comment 8 Ray Strode [halfline] 2016-05-24 13:03:03 UTC
--systemd is the default now I believe.   we should put this on the 3.20 branch, though.
Comment 9 Laurent Bigonville 2016-05-24 13:17:26 UTC
Ray, the manpage doesn't seem to mention that --systemd is the default
Comment 11 Simon McVittie 2016-05-24 15:16:16 UTC
(In reply to Ray Strode [halfline] from comment #8)
> --systemd is the default now I believe.

No it isn't. However, in recent dbus-daemon versions, the UpdateActivationEnvironment() method will copy the environment into the system user bus, if dbus-daemon was run with --systemd-activation.

There are four possibilities: (d-d-a-e with --systemd or not) x (dbus-daemon with --systemd-activation or not).

Old per-X11-session D-Bus session:

      UpdateActivationEnvironment
d-d-a-e ------------------> dbus-daemon

      UpdateActivationEnvironment
d-d-a-e    /--------------> dbus-daemon
--systemd {
           \---------------------------------------------> systemd
                           SetEnvironment

With --systemd-activation (i.e. ./configure --enable-user-session):

      UpdateActivationEnvironment         SetEnvironment
d-d-a-e ------------------> dbus-daemon -----------------> systemd


      UpdateActivationEnvironment        SetEnvironment
d-d-a-e    /--------------> dbus-daemon ----------------> \
--systemd {                                                } systemd
           \--------------------------------------------> /
                           SetEnvironment
Comment 12 Simon McVittie 2016-05-24 15:19:16 UTC
tl;dr:

If you want to set the environment for D-Bus service activation, however it is implemented, just run dbus-update-activation-environment.

If you want to guarantee that you are setting the environment for D-Bus service activation *and* for direct systemd activation (e.g. socket activation or systemctl start), run `dbus-update-activation-environment --systemd`, or alternatively, run d-d-a-e and separately run `systemctl set-environment` or `systemctl import-environment`.
Comment 13 Michael Catanzaro 2016-07-11 22:48:47 UTC
(In reply to Laurent Bigonville from comment #7)
> Also, shouldn't --systemd also be passed to
> dbus-update-activation-environment ?

FYI, this commit fixes localization of D-Bus activatable apps in Fedora 24. It does not fix localization of systemd-activated apps, notably gnome-terminal. I wonder if we need to be using --systemd here to fix this.
Comment 14 Michael Catanzaro 2016-07-12 02:20:41 UTC
(In reply to Michael Catanzaro from comment #13)
> It does not fix localization of systemd-activated apps, notably
> gnome-terminal. I wonder if we need to be using --systemd here to fix this.

Nope, that's not sufficient.