Closed wwade closed 3 years ago
After digging around, this definitely can't happen -- a sysfs in a netns has a special /sys/class/net and /sys/devices/virtual/net directories, so bind-mounting the host /sys is almost always incorrect.
I encountered the same EPERM problem recently -- it turns out that a /sys mount willl EPERM if the user asks to mount it read-write, and the host /sys is read-only. So the solution is fairly simple: just mount the inner sys read-only.
Either of these may be correct in a given situation, or may fail
Host sysfs mount === user ns sysfs mount:
Other:
Maybe bst should just fallback to a rbind mount when it EPERMs, and add a --no-fallback-sysfs-mount