Can't get mount namespaces to behave as expected
Can't get mount namespaces to behave as expected
Posted Mar 7, 2015 10:04 UTC (Sat) by mkerrisk (subscriber, #1978)In reply to: Can't get mount namespaces to behave as expected by apollock
Parent article: Namespaces in operation, part 4: more on PID namespaces
So, going back to your earlier comment:
> It looks like I have to do the same thing to /proc prior to mounting it
Yes, you're right. I was getting confused with another case, where if we mount a procfs at a location other than the usual /proc, then we need to make / a private or slave mount in order not to have that mount appear in the initial mount namespace.
So, in fact all that's needed if we're mounting at /proc inside the simple_init program is
# ./ns_child_exec -p -m ./simple_init init$ mount --make-slave /proc # <== NEW init$ mount -t proc proc /proc init$ ps aNothing needs to be done to /, as far as I can tell.
