Comment on Strange cAdvisor Issue
cass80@programming.dev 3 days ago
You have two things happening at once.
First. There a process that cleans up tmp files according to a configuration. Yours is probably set to clean files older than a day.
www.freedesktop.org/software/…/tmpfiles.d.html for more information
Second, As to the folder. Docker will create a folder with the bind mount’s name if it’s not found. So Docker tries to find your promethius file, doesn’t find it, then creates a folder with that name and mounts it instead.
You should move the files out of tmp. That’ll solve all your problems.
irmadlad@lemmy.world 2 days ago
Done. Standing by to stand by.
Thank you!
speculate7383@lemmy.today 2 days ago
That’s like keeping your lunch laying outside on the sidewalk, getting stepped on by people and destroyed, and then wondering if your lunch would be safer if you put it in a stronger bag (but still left it on the sidewalk).
Don’t leave your lunch outside laying on the sidewalk, regardless of what you might do to “protect” it. Don’t keep important files in /tmp
irmadlad@lemmy.world 2 days ago
I get that. It would seem tho, you could make the file immutable with
sudo chattr +i /tmp/cadvisor/prometheus.yml
speculate7383@lemmy.today 2 days ago
Yes, many bad ideas are possible to implement. At least temporarily. Until the next cleanup process figures out how to remove cadvisor dir regardless of file contents. Or the next OS release turns /tmp into a ram disk. Or… or… or…
Yes, it’s a fun academic exercise to think through possible mitigations. And in the end, it will still be dumb to keep this in /tmp
cass80@programming.dev 2 days ago
My guess is the cleanup process is running as root and clobbers anything it sees regardless of permissions. But that’s a guess. I’ve never tried keeping long term data in tmp.
irmadlad@lemmy.world 2 days ago
Sounds plausible. Thank you for your time and response.