Summary: | Handbook: add --make-rprivate to rbind mount options to work around systemd behavior | ||
---|---|---|---|
Product: | [OLD] Docs on www.gentoo.org | Reporter: | RedEyedMan <kegalym2> |
Component: | Installation Handbook | Assignee: | Docs Team <docs-team> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexander, systemd |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Testing chroot with --rbind on systemd
Optional patch reverting private mount propagation Optional patch reverting private mount propagation |
Description
RedEyedMan
2014-11-29 16:28:50 UTC
So, I can't use --rbind when systemd is used, but I can do same thing when openrc is active. With systemd there should be used --bind and it not breaks new bash session. It's a feature, not a bug. :) systemd marks / as shared: $ findmnt -o TARGET,PROPAGATION / TARGET PROPAGATION / shared (In reply to Alexander Tsoy from comment #2) > It's a feature, not a bug. :) systemd marks / as shared: > > $ findmnt -o TARGET,PROPAGATION / > TARGET PROPAGATION > / shared Yes, Lennart did it in this commit: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d8660023d6564a7c411f0a0 So, chroot should be mount with --make-rprivate --rbind (In reply to Galym Kerimbekov from comment #0) > http://pastebin.com/MLP2D52K Please attach any relevant data to this bug report. Created attachment 390654 [details]
Testing chroot with --rbind on systemd
Unmounting chroot that mount with --rbind on systemd also unmounts things related to system with negative effect to bash.
Sorry if my technical terminology is wrong, I trying to not use it.
I noticed that Gentoo handbook points to use mount --rbind that works well if you're doing it on system that have sysvinit/openrc, but it isn't work well of there is systemd. Systemd marks / as shared as Alexander noticed. So, imo, Handbook should notice to use --make-rprivate --rbind instead, if users going to build in chroot on their systems which have systemd. I mean because not all users builds Gentoo from Minimal CD. Anyway, it is just my opinion :) Created attachment 390690 [details, diff]
Optional patch reverting private mount propagation
Optional patch reverting private mount propagation (ms_private)
Created attachment 390694 [details, diff]
Optional patch reverting private mount propagation
Optional patch reverting private mount propagation (ms_private) Fixed mistakes in commenting code
This is basically a duplicate of bug 516980. We are definitely not going to conditionally patch this, and systemd upstream is not going to change the "shared" mount behavior. Docs team: please consider changing the handbook per comment 6. If you have any questions, feel free to ask. Thanks. I've added the --make-rprivate mount options. They do not seem to cause problems with non-systemd deployments. The make-rprivate, unlike what was expected from the documentation, removed the submounts on /sys and /dev (well, /mnt/gentoo/{sys,dev}). We're now documenting first the --rbind and then the --make-rslave option. Hopefully that still fixes the systemd behavior? (In reply to Sven Vermeulen from comment #11) Interesting. Yes, make-rslave should also resolve the umount strangness. |