Closed refi64 closed 5 years ago
I don't see that happening here. all the bwrap processes that are involved in setting up the spawned sandbox are gone when the command exits, With 1.1.1
Okay, revised command:
flatpak run --talk-name=org.freedesktop.Flatpak --command=flatpak-spawn org.freedesktop.Platform//18.08 --host sleep 30
This should be reliably reproducible.
ok, several minor issues become apparent here:
FWIW this is also reproducible with an actual app instead of just the plain runtime.
The part about app-less sandboxes is tangential here. And my analysis of the actual problem is still unclear.
It does seem that there is a problem with signal forwarding at least. flatpak-spawn says that it is forwarding the signal, but I never see it appear in the session helper.
Removing --host is also insightful. It turns out that you can't actually call into portals from app-less sandboxes:
Failed to call flatpak portal: GDBus.Error:org.freedesktop.DBus.Error.Failed: Authorization error: Key file does not have group “Application”
Some more playing around:
Using kill -INT to sent SIGINT just to the flatpak-spawn process does work as expected - the signal gets forwarded, the sleep process dies, and that in turn gets relayed to flatpak-spawn, causing it to exit.
Ctrl-C does not work correctly - the flatpak-spawn process is trying to forward the signal, but it gets a 'connection closed' error - my guess is that Ctrl-C kills the process group and takes down the dbus proxy first.
Maybe flatpak-spawn should die when it loses its bus connection.
I think with the just merged changes, things should work mostly as expected. You'll have to wait for 1.2 to use --watch-bus
Reproduced with Flatpak 0.99.3 on Fedora Silverblue 28.
TL;DR: Run this, then try shutting down your system:
(Any app works; I just randomly picked Photos here.)
systemd will hang for 2 minutes saying it's stuck waiting for a stop job.
sleep
will still be running.