podman optimize relabel of mount point #24210
Replies: 4 comments 10 replies
-
Are you actually using I know the issue you are talking about, I also have a volumes that takes minutes to relabel so I very much interested in ideas to improve this but I do not see the current behavior as bug. |
Beta Was this translation helpful? Give feedback.
-
My bad, I use I don't know how selinux stuff works now. But based on a wild guess, the only thing that comes to mind is deriving the private id from some container properties and when the root of the mount matches, then don't relabel. Or just read what is already there in the mount root. And in case no other container uses that id already, use that id otherwise relabel. I'm planning to upload a lot of data. I think startup times will become unacceptable very soon as I've just uploaded a sample of everything I want to keep there. I guess I can switch to |
Beta Was this translation helpful? Give feedback.
-
If you Then don't add the :z or :Z then SELinux should work fine with the quadlet without any relabeling. As long as the directory tree does not get removed it will stay labeled container_file_t and all content added to the tree will get that label. If you remove the tree for any reason, then when you recreate the tree do the mkdir PATODIR/; chcon -t container_file_t PATHTODIR and start copying the content, it will all get labeled correctly and the containers will be able to read/write the content. |
Beta Was this translation helpful? Give feedback.
-
Another idea, again I don't know whether it is possible or not, to label just the root as private but all else to be shared. This should prevent other containers to read the files inside in normal conditions. In this case on every restart only a single label will be updated. It could be a separate flag like |
Beta Was this translation helpful? Give feedback.
-
Issue Description
I'm using podman rootless to run a seafile server with many files. On startup it appears as if it is relabeling for a long time before container starts.
I read that podman optimizes relabeling when directory was once labeled with
z
but in this case I'm using a systemd service via Quadlet. So each startup a new container is created. It is not starting the same one.I think it is important to support this use case.
Any ideas for workarounds are also appreciated.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
it is slow on every startup
Describe the results you expected
second startup does not relabel all files
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions