You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiple instances of the same app don't share XDG_RUNTIME_DIR #4120
Two instances of the same app don't share most of XDG_RUNTIME_DIR. This seems inconsistent with the spec, and in particular means that if they try to communicate via app-specific sockets or flag-files in $XDG_RUNTIME_DIR, each one will usually think it's the only instance, whereas if they were running in a non-Flatpak environment, they'd communicate.
This is similar to #4091, and might make sense to fix as part of #4093.
[Recipes]$ ls -al $XDG_RUNTIME_DIR $XDG_RUNTIME_DIR/app/$FLATPAK_ID
Exit from both instances. Start a third instance (without logging out completely), and look in those directories again.
Expected result
I would have expected the first two (concurrent) instances to see all four sockets 1a, 2a, 1b and 2b. This could be achieved by giving them the same directory as $XDG_RUNTIME_DIR, and then mounting sockets like bus and wayland-0 on top of that.
I think I would expect the third (non-concurrent) instance to see all four sockets, but I think it would be OK if they all disappeared, or if both the a sockets were kept and both the b sockets disappeared, or vice versa; it isn't clear to me what should happen here, and I think it's fine for it to be an implementation detail.
If I log out completely, and log back in, then 1a, 2a, 1b and 2b will disappear.
Actual result
All three instances can see 1b and 2b, in the Flatpak-specific directory $XDG_RUNTIME_DIR/app/$FLATPAK_ID.
Only the first instance can see 1a.
Only the second instance can see 2a.
If I log out completely, and log back in, then 1a, 2a, 1b and 2b will disappear, as expected.
run: Mount /run/user/$uid/app/$appid in the sandbox
This directory is shared between all instances of the app, as well
as the host. In many ways this is similar to the ~/.var/app/$appid
directory, but the directory is guaranteed to not be persistent (/run
is on tmpfs), local to the host (not NFS), as well as nice support
for features like locks and mmap (due to being tmpfs).
So this seems to be trying to be XDG_RUNTIME_DIR, more or less? ... except that it's only useful for apps that have been modified to use this Flatpak-specific directory, and not for generic app/library code that is more likely to use something like XDG_RUNTIME_DIR/myapp.socket.
Activity
Implement per-app shared XDG_RUNTIME_DIR, /dev/shm and /tmp directories
Implement per-app shared XDG_RUNTIME_DIR, /dev/shm and /tmp directories
Implement per-app shared XDG_RUNTIME_DIR, /dev/shm and /tmp directories
smcv commentedon Feb 15, 2021
Commit 24c691f says:
run: Mount /run/user/$uid/app/$appid in the sandbox
This directory is shared between all instances of the app, as well
as the host. In many ways this is similar to the ~/.var/app/$appid
directory, but the directory is guaranteed to not be persistent (/run
is on tmpfs), local to the host (not NFS), as well as nice support
for features like locks and mmap (due to being tmpfs).
So this seems to be trying to be XDG_RUNTIME_DIR, more or less? ... except that it's only useful for apps that have been modified to use this Flatpak-specific directory, and not for generic app/library code that is more likely to use something like
XDG_RUNTIME_DIR/myapp.socket.run: Create a shared XDG_RUNTIME_DIR for each app-ID
run: Create a shared XDG_RUNTIME_DIR for each app-ID
instance: Add infrastructure for per-app-ID subdirs of XRD/.flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID
instance: Add infrastructure for per-app-ID subdirs of XRD/.flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID
run: Create a shared XDG_RUNTIME_DIR for each app-ID
instance: Add infrastructure for per-app-ID subdirs of XRD/.flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID
test-instance: Provide app-IDs for our mock apps
instance: Create and destroy per-app-ID subdirs of XRD/.flatpak
test-instance: Provide app-IDs for our mock apps
instance: Create and destroy per-app-ID subdirs of XRD/.flatpak
test-instance: Provide app-IDs for our mock apps
instance: Create and destroy per-app-ID subdirs of XRD/.flatpak
run: Populate XDG_RUNTIME_DIR with symlinks into /run/flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID
run: Delay allocation of per-app directory
run: Populate XDG_RUNTIME_DIR with symlinks into /run/flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID
run: Delay allocation of per-app directory
run: Populate XDG_RUNTIME_DIR with symlinks into /run/flatpak
run: Create a shared XDG_RUNTIME_DIR for each app-ID