-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option to make mountpoints shared #525
Comments
It would be nice to have this configurable, one way or the other, and I think /etc/init.d/root would be the proper place. |
I read the Alpine issue, and I'm open to this, but I have a question. |
Can it be done with mount options in fstab? I couldn't get it to work. mount options shared or private work for new mounts, but as far as I can see:
My intention was to add handling in init.d/root that would just call Is there any preference to which way the default should go? all mount implementations might not support make-rshared (I'm not sure it'd make sense on BSDs, not sure how mount propagation work there this all looks very linux-y), so default of not doing anything and adding mount --make-rshared if shared is present is probably the best? |
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes OpenRC#525.
It will merge it to the near future? I use Alpine linux to a Docker host and this settings that would be good to docker volumes... |
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes OpenRC#525.
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes OpenRC#525.
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes #525.
containers on linux might require filesystems to be mounted with different propagation than the kernel default of 'private': by setting 'shared' in fstab for / options, one can now make the fs hierarchy shared. Note we use 'rshared' to make other existing mounts shared as well because the setting is contagious and it seemed more logical to behave as if the setting was set on / immediately (and thus inherited by other mounts) This fixes OpenRC#525.
Hello,
I'd be interested in making all mountpoints shared (for example by allowing to run
mount --make-rshared /
in init.d/root) in alpine.The implementation itself isn't difficult, busybox mount does support --make-rshared despite not being listed in the help so it's just a matter of adding a setting (EDIT: original idea was to look for 'shared' in
fstabinfo -o /
) and doing it -- I'll be happy to open a PR if there is some approval first.I was told to ask here in the alpine ticket: https://gitlab.alpinelinux.org/alpine/tsc/-/issues/42
(rationale below copied from that link verbatim)
-=-
The rationale for this is that I selfishly need to have some mountpoints mounted as shared for some container usages (when alpine is the host OS), in order to backpropagate mounts made by a privileged container in a volume marked as 'shared'.
In my case the volumes shouldn't be made directly off /, so just marking the FS where volumes should be as shared is probably going to be enough but it's not something I have direct control of so I'd be more comfortable with / marked shared as systemd has been doing (not a great argument admittedly... But it's what users are used to)
FWIW, it looks like podman 4 in rootless mode also seems to depend on it: containers/podman#12721 and aports#13541 (closed) (the hang might not be related but it illustrates the warning message being shown), so we might get other requests at this point.
-=-
Thank you!
The text was updated successfully, but these errors were encountered: