GNOME Bugzilla – Bug 766176
gnome-session: update activation environment at startup
Last modified: 2016-07-12 02:20:41 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
Created attachment 327521 [details] [review] gnome-session: update activation environment at startup
Attachment 327521 [details] pushed as d14f6db - gnome-session: update activation environment at startup
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 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
Shouldn't this patch also be backported to the 3.20 branch?
*** Bug 766819 has been marked as a duplicate of this bug. ***
Also, shouldn't --systemd also be passed to dbus-update-activation-environment ?
--systemd is the default now I believe. we should put this on the 3.20 branch, though.
Ray, the manpage doesn't seem to mention that --systemd is the default
see https://github.com/alexlarsson/xdg-app/issues/147#issuecomment-216230465
(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
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`.
(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.
(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.