Top |
GPtrArray * | flatpak_instance_get_all () |
const char * | flatpak_instance_get_id () |
const char * | flatpak_instance_get_app () |
const char * | flatpak_instance_get_arch () |
const char * | flatpak_instance_get_branch () |
const char * | flatpak_instance_get_commit () |
const char * | flatpak_instance_get_runtime () |
const char * | flatpak_instance_get_runtime_commit () |
int | flatpak_instance_get_pid () |
int | flatpak_instance_get_child_pid () |
GKeyFile * | flatpak_instance_get_info () |
gboolean | flatpak_instance_is_running () |
A FlatpakInstance refers to a running sandbox, and contains some basic information about the sandbox setup, such as the application and runtime used inside the sandbox.
Importantly, it also gives access to the PID of the main processes in the sandbox.
One way to obtain FlatpakInstances is to use flatpak_instance_get_all()
.
Another way is to use flatpak_installation_launch_full()
.
Note that process lifecycle tracking is fundamentally racy. You have to be prepared for the sandbox and the processes represented by a FlatpakInstance to not be around anymore.
The FlatpakInstance api was added in Flatpak 1.1.
GPtrArray *
flatpak_instance_get_all (void
);
Gets FlatpakInstance objects for all running sandboxes in the current session.
Since: 1.1
const char *
flatpak_instance_get_id (FlatpakInstance *self
);
Gets the instance ID. The ID is used by Flatpak for bookkeeping purposes and has no further relevance.
Since: 1.1
const char *
flatpak_instance_get_app (FlatpakInstance *self
);
Gets the application ID of the application running in the instance.
Note that this may return NULL
for sandboxes that don't have an application.
Since: 1.1
const char *
flatpak_instance_get_arch (FlatpakInstance *self
);
Gets the architecture of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_branch (FlatpakInstance *self
);
Gets the branch of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_commit (FlatpakInstance *self
);
Gets the commit of the application running in the instance.
Since: 1.1
const char *
flatpak_instance_get_runtime (FlatpakInstance *self
);
Gets the ref of the runtime used in the instance.
Since: 1.1
const char *
flatpak_instance_get_runtime_commit (FlatpakInstance *self
);
Gets the commit of the runtime used in the instance.
Since: 1.1
int
flatpak_instance_get_pid (FlatpakInstance *self
);
Gets the PID of the outermost process in the sandbox. This is not the application process itself, but a bubblewrap 'babysitter' process.
See flatpak_instance_get_child_pid()
.
Since: 1.1
int
flatpak_instance_get_child_pid (FlatpakInstance *self
);
Gets the PID of the application process in the sandbox.
See flatpak_instance_get_pid()
.
Note that this function may return 0 immediately after launching a sandbox, for a short amount of time.
Since: 1.1
GKeyFile *
flatpak_instance_get_info (FlatpakInstance *self
);
Gets a keyfile that holds information about the running sandbox.
This file is available as /.flatpak-info inside the sandbox as well.
The most important data in the keyfile is available with separate getters, but there may be more information in the keyfile.
Since: 1.1
gboolean
flatpak_instance_is_running (FlatpakInstance *self
);
Finds out if the sandbox represented by self
is still running.