docs: systemd unit example to mount root as a shared mount #1911
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.
Hi.
Recently I decided to set up Distrobox on my (more-or-less) vanilla Ubuntu 24.04 host, and I ran into the "root filesystem is not mounted as a shared mount" problem.
The current compatibility page suggests to run
mount --make-rshared /command and to add it to/etc/rc.local"to make it permanent". Whilemount --make-rshared /absolutely works, "add it to/etc/rc.local" does not./etc/rc.localwas not present on my system, and just creating it was not enough (it did nothing).If I understand correctly,
/etc/rc.localis considered deprecated (in Ubuntu, at least) in favor of systemd units, and to make it work you need to create some kind ofrc-local.service- and there was no such service in my system.If you need to interact with systemd anyway, you may as well create a proper service for the task. I believe this approach is more "in line" with what most distros consider "up to date".
Here I propose an addition to the compatibility page that explains how it can be done.
This solution is tested by me on my machine. But the service is quite simple, and I can't think of a reason why shouldn't it work on any other systemd-enabled system.