From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Subject: [PATCH v2] proc(5): clarify the root symlink and mount namespaces Date: Thu, 6 Oct 2016 13:23:22 -0400 Message-ID: <20161006172322.3253-1-vapier@gentoo.org> References: <20161006013609.17481-1-vapier@gentoo.org> Return-path: In-Reply-To: <20161006013609.17481-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> Sender: linux-man-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Michael Kerrisk Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-man@vger.kernel.org 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. Signed-off-by: Mike Frysinger --- 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 -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html