Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
D-Bus activated apps don't know about xdg-apps #147
Comments
|
The problem is that XDG_DATA_DIRS in the D-Bus activated app isn't correct. You can verify that if you have an "open terminal" type launched in nautilus. |
|
We could fix this with a big hammer and export this in gnome-session directly. |
|
Ahh, i see. Yeah, the problem is how xdg-app gets to install something into XDG_DATA_DIRS. I fixed this with the fedora packaging by adding gdm support for /usr/share/gdm/env.d/xdg-app.env which gets run before the dbus daemon However, maybe you are using e.g. a jhbuild xdg-app, which does not set this up? |
|
Nope, I'm using the distro version of xdg-app.
|
|
It's possible that I misinterpreted this, and it's indeed a nautilus bug. |
|
Did you re-log-in after installing xdg-app? |
|
And, is XDG_DATA_DIRS in cat /proc/session-bus-pid/environ with the ~/.local/share/xdg-app/exports/share dir? |
Yes
Looks like it isn't. But is in a gnome-shell launched gnome-terminal:
But is in gnome-shell's environment:
|
|
The gdm env.d file should be parsed pretty damn early, so I don't understand why it is not in your dbus-daemon environment. Very strange. |
|
Fedora 24 defaults to the user bus, so dbus is activated by systemd, not by gdm, and it never sees the env.d snippets. (gnome-terminal is also dbus activated, but it asks the launcher for the environment explicitly, hence it does not suffer from this bug) |
|
Yeah, the user services need to have the XDG_DATA_DIR too |
|
@halfline: Who can look into this? |
halfline
commented
Apr 28, 2016
•
|
man, how many times today do i have to shake my fist at environment variables? maybe pam_systemd should be doing the equivalent of "systemctl --user import-environment" at pam_open_session time. it's a little weird that per-session variables (like XDG_SESSION_ID etc) would get set in processes that aren't running in a specific session, but I guess it's no more weird than DISPLAY which we already have and need. @poettering might have an opinion on this bug. Doing that change won't fix this issue though, since we load env.d after pam_open_session. we could move where env.d is processed to earlier, of course. I think the easiest change would be to put dbus-update-activation-environment --all --systemd in /usr/bin/gnome-session (which is shell script wrapper we already have because environment variables are fist worthy). |
|
For the record, systemctl import-environment at some point was in Xsession scripts. But we stopped running Xsession scripts and stuff broke. In any case, and for the specific case of xdg-app, you can make a drop-in file of the form and forget about the import-environment stuff. |
|
@gcampax That sounds awesome. Also fixes things that don't use gdm, but uses user sessions. |
|
@gcampax Unfortunately it seems %h expanded to /root when i did this... |
|
@poettering I created a
And when i logged in as "alex" the session bus daemon got:
Is it meant to do that? Should not %h expand to /home/alex ? |
|
Its pretty weird. %u expands to "root" also, even though the main service file has "User=%i" and %i expands correctly (to 1000). I even added "User=%i" to my conf file in case there was some ordering issue, but it did not help. |
We do the not-requiring-systemd equivalent in Debian too, but with a few obviously-session-specific variables filtered out, and only if you have the Please prefer to use |
|
@smcv we need the env vars set even in wayland, so I don't get why it should be a x11 dependency? |
|
In Debian, the Xsession.d glue is in I agree that |
|
@smcv I don't want to modify a user-owned directory like the users ~/.local/share. For instance, when apps are uninstalled we remove desktop files from them. But ~/.local/share is where user-customized options like "open with" extra mimetypes etc are stored. Same goes for the system xdg-app dir (/var/lib/xdg-app/exports/share), i don't want installing xdg-apps to modify /usr/share/ because it has data from other sources. |
added a commit
to halfline/gnome-session
that referenced
this issue
May 9, 2016
pushed a commit
to GNOME/gnome-session
that referenced
this issue
May 9, 2016
halfline
commented
May 9, 2016
|
i pushed a workaround here: https://bugzilla.gnome.org/show_bug.cgi?id=766176 so you can probably close this out. |
|
Sure. |
hadess commentedApr 28, 2016
Originally in:
https://bugzilla.gnome.org/show_bug.cgi?id=765716
https://github.com/hadess/hadess-xdg-app