Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#927907: flatpak directories are not in the search path set by the XDG_DATA_DIRS

3,158 views
Skip to first unread message

Ioan Eugen Stan

unread,
Apr 24, 2019, 5:20:02 PM4/24/19
to
Package: flatpak
Version: 1.2.4-1
Severity: normal

Dear Maintainer,

I tried to `flatpak --user update` and I got this message.
I think flatpak should be added by default to the XDG_DATA_DIRS env.

I think flatpak is a very nice piece of technology.

```sh
▶ flatpak --user update

Note that the directories

'/var/lib/flatpak/exports/share'
'/home/ieugen/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

Looking for updates…
Nothing to do.
```
My XDG_DATA_DIRS looks like this:
```
▶ env | grep XDG_DATA_DIRS
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
```

I switched to Plasma under Wayland recently, don't know if it is important. I'm
running Debian Buster (mostly) with some third party packages and some from
sid.


-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-4-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ro_RO.UTF8, LC_CTYPE=ro_RO.UTF8 (charmap=UTF-8), LANGUAGE=ro:en_US (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages flatpak depends on:
ii bubblewrap 0.3.1-4
ii libappstream-glib8 0.7.14-1
ii libarchive13 3.3.3-4
ii libc6 2.28-8
ii libdconf1 0.30.1-2
ii libgdk-pixbuf2.0-0 2.38.1+dfsg-1
ii libglib2.0-0 2.58.3-1
ii libgpgme11 1.12.0-6
ii libjson-glib-1.0-0 1.4.4-2
ii libostree-1-1 2019.1-1
ii libpolkit-agent-1-0 0.105-25
ii libpolkit-gobject-1-0 0.105-25
ii libseccomp2 2.3.3-4
ii libsoup2.4-1 2.64.2-2
ii libsystemd0 241-3
ii libxau6 1:1.0.8-1+b2
ii libxml2 2.9.4+dfsg1-7+b3
ii xdg-dbus-proxy 0.1.1-1
ii xdg-desktop-portal 1.2.0-1

Versions of packages flatpak recommends:
ii desktop-file-utils 0.23-4
ii gtk-update-icon-cache 3.24.5-1
ii hicolor-icon-theme 0.17-2
ii libpam-systemd 241-3
ii p11-kit 0.23.15-2
ii policykit-1 0.105-25
ii shared-mime-info 1.10-1
ii xdg-desktop-portal-gtk [xdg-desktop-portal-backend] 1.2.0-1

Versions of packages flatpak suggests:
ii avahi-daemon 0.7-4+b1

-- no debconf information

Simon McVittie

unread,
Aug 30, 2019, 3:40:03 AM8/30/19
to
Control: retitle -1 flatpak directories not added to XDG_DATA_DIRS on Plasma + Wayland

On Thu, 25 Apr 2019 at 00:10:51 +0300, Ioan Eugen Stan wrote:
> Note that the directories
>
> '/var/lib/flatpak/exports/share'
> '/home/ieugen/.local/share/flatpak/exports/share'
>
> are not in the search path set by the XDG_DATA_DIRS environment variable
...
> I switched to Plasma under Wayland recently, don't know if it is important.

This presumably means your session startup won't source
/etc/X11/Xsession.d/20flatpak like an X11 session would. GNOME in Wayland
mode doesn't do that either, so at least they're consistent.

Setting environment variables during session startup is, unfortunately,
still a bit of a mess. Flatpak tries to add its directories to
XDG_DATA_DIRS in several ways:

- /etc/X11/Xsession.d/20flatpak (X11-specific)
- /etc/profile.d/flatpak.sh (shell-specific)
- /usr/share/gdm/env.d/flatpak.env (GNOME/GDM-specific)

but apparently Plasma in Wayland mode doesn't use any of those.

Perhaps the answer is for Flatpak to have a systemd environment generator,
systemd.environment-generator(7), instead of or in addition to the
hooks we currently have? That would leave out sysvinit users, but that
isn't necessarily a huge problem, because they probably aren't using
Wayland anyway.

Or if there is a Plasma-specific mechanism similar to the GDM-specific
/usr/share/gdm/env.d (which is used by GNOME in Wayland mode) then
Flatpak could use that too, but I'd need details of that mechanism.

smcv

Simon McVittie

unread,
Aug 30, 2019, 5:00:03 AM8/30/19
to
On Fri, 30 Aug 2019 at 08:17:47 +0100, Simon McVittie wrote:
> Perhaps the answer is for Flatpak to have a systemd environment generator,
> systemd.environment-generator(7), instead of or in addition to the
> hooks we currently have?

Actually, it has had one of these since 1.1.3, so that can't be it. Please
check whether /usr/lib/systemd/user-environment-generators/60-flatpak is
getting run when you log in?

smcv

David Nebauer

unread,
Jun 14, 2020, 5:20:03 AM6/14/20
to
Package: flatpak
Version: 1.6.3-1
Followup-For: Bug #927907

Dear Maintainer,

I had the exact same problem immediately following installation of the
flatpak deb package, in that XDG_DATA_DIRS had not been altered.
Following a reboot, however, both the local and system
flatpack/exports/share directories were prepended to XDG_DATA_DIRS
(maybe due to /usr/lib/systemd/user-environment-generators/60-flatpak).

If I experienced the same problem the earlier reporters did, perhaps the
solution is to (a) warn the users that a reboot (or just a fresh log in)
is necessary for the XDG_DATA_DIRS variable to be updated, or perhaps
(b) so something clever to adjust the XDG_DATA_DIRS variable during
package installation.

-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (995, 'testing'), (750, 'stable'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.6.0-2-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE= (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages flatpak depends on:
ii adduser 3.118
ii bubblewrap 0.4.1-1
ii libappstream-glib8 0.7.17-1
ii libarchive13 3.4.3-1
ii libc6 2.30-8
ii libdconf1 0.36.0-1
ii libfuse2 2.9.9-3
ii libgdk-pixbuf2.0-0 2.40.0+dfsg-5
ii libglib2.0-0 2.64.3-1
ii libgpgme11 1.13.1-6
ii libjson-glib-1.0-0 1.4.4-2
ii libostree-1-1 2020.3-1
ii libpolkit-agent-1-0 0.105-26
ii libpolkit-gobject-1-0 0.105-26
ii libseccomp2 2.4.3-1+b1
ii libsoup2.4-1 2.70.0-1
ii libsystemd0 245.6-1
ii libxau6 1:1.0.8-1+b2
ii libxml2 2.9.10+dfsg-5+b1
ii xdg-dbus-proxy 0.1.2-1

Versions of packages flatpak recommends:
ii desktop-file-utils 0.24-1
ii gtk-update-icon-cache 3.24.20-1
ii hicolor-icon-theme 0.17-2
ii libpam-systemd 245.6-1
ii p11-kit 0.23.20-1
ii policykit-1 0.105-26
ii shared-mime-info 1.15-1
ii xdg-desktop-portal 1.6.0-1
ii xdg-desktop-portal-gtk [xdg-desktop-portal-backend] 1.6.0-1+b1

Versions of packages flatpak suggests:
ii avahi-daemon 0.8-3

-- no debconf information

Tobias Gruetzmacher

unread,
Apr 16, 2022, 7:40:03 AM4/16/22
to
Package: flatpak
Version: 1.12.7-1
Followup-For: Bug #927907

Hi,

unfortunatly, this is still an issue with Plasma. As previously noted,
this should be covered by the user-environment-generator, but it seems
Plasma isn't using those by default (or their result isn't propagated?),
since it's not integrated in the systemd user session. This can be
actived by:

kwriteconfig5 --file startkderc --group General --key systemdBoot true

This makes the environment generator work.
https://invent.kde.org/plasma/plasma-workspace/-/wikis/Plasma-and-the-systemd-boot
suggests distros not enable this by default, since it breaks drkonqi :(

Until this becomes the default, maybe add a file
/etc/xdg/plasma-workspace/env/flatpak.sh with the content:

eval `GIO_USE_VFS=local flatpak --print-updated-env`
export XDG_DATA_DIRS

This should add the missing configuration to all new Plasma sessions.

See also:
- https://userbase.kde.org/Session_Environment_Variables/en
- https://invent.kde.org/plasma/plasma-workspace/-/blob/master/startkde/startplasma.cpp#L284-301

Best regards, Tobias

-- Package-specific info:
Permissions of /usr/bin/bwrap:
-rwxr-xr-x 1 root root 67984 Feb 25 18:46 /usr/bin/bwrap
/etc/sysctl.d/*-bubblewrap.conf:
cat: '/etc/sysctl.d/*-bubblewrap.conf': No such file or directory
/usr/lib/sysctl.d/50-bubblewrap.conf:
# Enable unprivileged creation of new user namespaces in older Debian
# kernels.
#
# If this is not desired, copy this file to
# /etc/sysctl.d/50-bubblewrap.conf and change the value of this parameter
# to 0, then use dpkg-statoverride to make /usr/bin/bwrap setuid root.
#
# For more details see https://deb.li/bubblewrap or
# /usr/share/doc/bubblewrap/README.Debian
kernel.unprivileged_userns_clone=1
/proc/sys/kernel/unprivileged_userns_clone:
1
/proc/sys/user/max_cgroup_namespaces:
31361
/proc/sys/user/max_ipc_namespaces:
31361
/proc/sys/user/max_mnt_namespaces:
31361
/proc/sys/user/max_net_namespaces:
31361
/proc/sys/user/max_pid_namespaces:
31361
/proc/sys/user/max_time_namespaces:
31361
/proc/sys/user/max_user_namespaces:
31361
/proc/sys/user/max_uts_namespaces:
31361

-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.16.0-6-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE=de:en_GB:en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages flatpak depends on:
ii adduser 3.121
ii bubblewrap 0.6.1-1
ii dbus [default-dbus-system-bus] 1.14.0-1
ii libappstream-glib8 0.7.18-2
ii libarchive13 3.6.0-1
ii libc6 2.33-7
ii libdconf1 0.40.0-3
ii libfuse2 2.9.9-5
ii libgdk-pixbuf-2.0-0 2.42.8+dfsg-1
ii libglib2.0-0 2.72.1-1
ii libgpgme11 1.16.0-1.2
ii libjson-glib-1.0-0 1.6.6-1
ii libmalcontent-0-0 0.10.4-1
ii libostree-1-1 2022.2-3
ii libpolkit-agent-1-0 0.105-33
ii libpolkit-gobject-1-0 0.105-33
ii libseccomp2 2.5.3-2
ii libsoup2.4-1 2.74.2-3
ii libsystemd0 250.4-1
ii libxau6 1:1.0.9-1
ii libxml2 2.9.13+dfsg-1
ii libzstd1 1.5.2+dfsg-1
ii xdg-dbus-proxy 0.1.3-1

Versions of packages flatpak recommends:
ii ca-certificates 20211016
ii desktop-file-utils 0.26-1
ii gtk-update-icon-cache 3.24.33-1
ii hicolor-icon-theme 0.17-2
ii libpam-systemd 250.4-1
ii p11-kit 0.24.0-6
ii policykit-1 0.105-33
ii shared-mime-info 2.1-2
ii xdg-desktop-portal 1.14.2-1
ii xdg-desktop-portal-kde [xdg-desktop-portal-backend] 5.24.4-1
ii xdg-user-dirs 0.17-2

Versions of packages flatpak suggests:
pn avahi-daemon <none>
pn malcontent-gui <none>

Versions of packages bubblewrap depends on:
ii libc6 2.33-7
ii libcap2 1:2.44-1
ii libselinux1 3.3-1+b2

Versions of packages bubblewrap recommends:
ii procps 2:3.3.17-7+b1

-- no debconf information
0 new messages