Commit Graph

5 Commits

Author SHA1 Message Date
Matthias Clasen
6daf195e42 Instance: mitigate races, add new launch api
Avoid the 3-second 'afterlife' of instances by using
kill (pid, 0) instead of checking the file lock. We
trade pid for lock races, but this seems more reliable.

Also add flatpak_installation_launch_full that returns
a FlatpakInstance for the launched app, and lets us
avoid races around killing the app, by using a child
watch.

Closes: #2221
Approved by: matthiasclasen
2018-10-23 07:15:39 +00:00
Matthew Leeds
d5b8266a09 instance: Fix gtk-doc warning 2018-10-17 14:23:20 -07:00
Matthias Clasen
83bb5b9c52 instance: Be more defensive in get_child_pid
There is a race; flatpak_installation_launch may return
before bubblewrap has written the bwrapinfo.json file.
Make flatpak_instance_get_child_pid() deal with this and
document that the function may return 0 for a little
while.
2018-10-10 12:21:15 +02:00
Matthias Clasen
dd546ad365 Make FlatpakInstance api public
This can be of use in frontends like GNOME Software.

Closes: #2201
Approved by: alexlarsson
2018-10-08 08:36:23 +00:00
Matthias Clasen
336f887289 Add an instance api
This is made to let gnome-software enumerate all
running instances and get the same information
about them that flatpak ps provides.

For now, we keep it private. It will become library
api once we open new development
2018-09-03 11:54:19 -04:00