Re: [PATCH v2] proc(5): clarify the root symlink and mount namespaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike,

On 10/06/2016 07:23 PM, Mike Frysinger wrote:
> If the target process is in a different mount namespace, the root symlink
> actually shows that view of the filesystem.  As an example:
>  /* Terminal 1 */
>  $ unshare -Urnm
>  # mount -t tmpfs tmpfs /etc
>  # mount --bind /bin /dev
>  # echo $$
>  17168
> 
>  /* Terminal 2 */
>  # ls /etc                          # Normal view of /etc files.
>  # ls /proc/17168/root/etc          # Empty view of the tmpfs.
>  # ls /dev                          # Normal view of /dev files.
>  # ls /proc/17168/root/dev          # Contents of /bin files.

Thanks for the patch! And thanks for the commit message, which is I think
actually useful text for the man page itself, so I added it (in somewhat
modified form) to the page itself.

Cheers,

Michael

> Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
> ---
> v2
> 	- restore examples
> 
>  man5/proc.5 | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/man5/proc.5 b/man5/proc.5
> index 3a5f4407c657..0680902c54a5 100644
> --- a/man5/proc.5
> +++ b/man5/proc.5
> @@ -1513,6 +1513,10 @@ root directory, and behaves in the same way as
>  and
>  .IR fd/* .
>  
> +Note however that this file is not merely a symlink.
> +It provides the same view of the filesystem (including namespaces and the
> +set of per-process mounts) as the process itself.
> +
>  .\" The following was still true as at kernel 2.6.13
>  In a multithreaded process, the contents of this symbolic link
>  are not available if the main thread has already terminated
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux