X3n0m0rph59 / precached

Precached - A Linux process monitor and pre-caching daemon
https://x3n0m0rph59.gitlab.io/precached/
GNU General Public License v3.0
13 stars 0 forks source link

flatpak #11

Open idnovic opened 5 years ago

idnovic commented 5 years ago

Well I did not view all of my 1600 precached files but it seems precached does not preload files of flatpaks.

Maybe that is because of the layering of the filesystem. I do not mind that just something what seems to happen.

I expect that snaps may have the same effect.

X3n0m0rph59 commented 5 years ago

I want precached to support flatpak and snaps as well, so thank you for your report! I will investigate this...

idnovic commented 5 years ago

maybe create a plugin for this. Because the "normal" files used by flatpak are preloaded. Just not layered files. So the service and connector and libraries.

X3n0m0rph59 commented 5 years ago

OK, I have looked into this: To make this work, precached needs to instantiate fanotify watches on subordinate mounts in different mount-namespaces too, not just inside the root namespace.

idnovic commented 5 years ago

precached did seem to show interest in this folder: /app/* (I had dropbox installed over flatpak running, strange part is before that precached never seemed to care about my flatpak apps)

I added the rule below to my config for now because I had unexplained high cpu usage #14 "/app/*/",

X3n0m0rph59 commented 5 years ago

precached did seem to show interest in this folder: /app/*

Yes, these are paths used by flatpak "containerized" apps. But precached is currently unable to map the path inside of a mount namespace to the respective path outside of the mount namespace.

It seems that precached somehow got an fanotify event for the /app directory of a flatpak app.

I added the rule below to my config for now because I had unexplained high cpu usage

Has the high CPU usage problem been fixed by this change?

idnovic commented 5 years ago

I am not sure yet. Let me try to reproduce it.

X3n0m0rph59 commented 5 years ago

I just finished up a small prototype program in rust, that is able to monitor the / filesystem for changes, and if it detects that an event originated in a different mount namespace, will use /proc/$pid/mountinfo to map paths from inside the "container" to the outside namespace.

Confirmed to work with Flatpak, Snaps and Docker, etc. testing comming soon...