3 ms·
These are really good posts - I've been mucking about with namespaces recently at work and I wish I had known about this series before today, I wouldn't have ha
by sophacles 7y ago
These are really good posts - I've been mucking about with namespaces recently at work and I wish I had known about this series before today, I wouldn't have had to go figure out a bunch of stuff the hard way!
I hope some future part covers the nsfs and bind mount thing for persisting namespaces past a specific process. It took me way, way to long to catch this passage in the man page:
Bind mounting (see mount(2)) one of the files in this directory to somewhere else in the filesystem keeps the corresponding namespace of the process specified by pid alive even if all processes currently in the namespace terminate.
It's not that it's hard to understand, it's just poorly highlighted in most namespace discourse that I've seen. Persisting namespaces was very much a mystery to me - I had to break down and read the source to understand how the ip command persisted network namespaces before I understood the importance of that sentence.
- mav3rick 7y agoLWN has a very good series on namespaces and cgroups.
- sophacles 7y agoOh, good pointer - thanks!
- cyphar 7y agoThis technique works more generically to allow you to persist any file descriptor. That's probably why it wasn't mentioned in the documentation (it's just another tool in the toolbox).