Use an overlayfs on /etc to keep monitored files updated #5528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the monitored files are mounted in
/run/host/monitor/
and individual files are symlinked there from/etc
. If the file in/etc
must be a symlink itself this approach is failing (#5514).This patch sets up an overlayfs with
/run/host/monitor/
as the upper layer and/etc
as the lower layer and mount target./etc
itself is bind mounted instead of the individual files and folders which makes the whole dir read-only but we provide another overlay layer,/run/etc-overlay
is created to make it possible to override files in/etc
per-container.Everything seems to work. The implementation assumes that bwrap always supports
--overlay
. A real implementation would have to support the current code paths and the overlay stuff at the same time.bwrap --overlay support is here containers/bubblewrap#596