Install/Remove hooks

Alexander Larsson alexl at redhat.com
Mon May 27 09:46:38 UTC 2019


On Fri, May 24, 2019 at 5:32 PM Frédéric Pierret
<frederic.pierret at qubes-os.org> wrote:
>
> On 5/24/19 5:26 PM, Alexander Larsson wrote:
> > On Fri, May 24, 2019 at 5:09 PM Frédéric Pierret
> > <frederic.pierret at qubes-os.org> wrote:
> >> Hi all,
> >>
> >> Is there a way of creating pre or post actions during install/remove of
> >> a flatpak?
> >>
> >> As an example of what I mean, taking 'yum' or 'dnf', it is possible to
> >> add plugins for doing some actions after a 'dnf install somepackage'.
> >> That is very useful for us in QubesOS project and as we are integrating
> >> Flatpak (and further Fedora Silverblue), we are wondering if such a
> >> feature is/will be available for Flatpak.
> > Flatpak ships with a set of triggers in /usr/share/flatpak/triggers
> > that get run when things are installed/updated. However, these are run
> That's good new! :)
> > in very minimal sandboxes that only have write access to the limited
> > area they should write. In general we don't want downloading apps to
> > run arbitrary code, as that is not a great idea security wise. For
> > example if the trigger reads some file that the app installed and it
> > has a security hole then you could exploit such a trigger to run
> > things on the host.
> >
> > Can you explain in a bit more detail what it is you want to achieve?
> >
> We would like to trigger nothing related to the app itself but rather
> our own services. In this case, it is to notify that a new 'flatpak' as
> been installed. So the trigger would be to run a Qubes specific command
> only, more precisely, it's what we call a 'qrexec' service.

Do you need a "something changed" signal, or more details (like which
apps where updated, etc).
We already have a per-installation file for change notification. For
example, each time an app is installed or updated in the system
installation the file /var/lib/flatpak/.changed is modified, which
means a file monitor on that will give you an event every time
something gets installed.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                Red Hat, Inc
       alexl at redhat.com         alexander.larsson at gmail.com


More information about the Flatpak mailing list