linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v2] proc(5): clarify the root symlink and mount namespaces
Date: Fri, 7 Oct 2016 22:50:20 +0200	[thread overview]
Message-ID: <aa5443c2-34a9-b77d-0e13-dc5dba4ca0e8@gmail.com> (raw)
In-Reply-To: <20161007192100.GY21655-UgUKS2FnFs9+urZeOPWqwQ@public.gmane.org>

On 10/07/2016 09:21 PM, Mike Frysinger wrote:
> On 07 Oct 2016 14:33, Michael Kerrisk (man-pages) wrote:
>> 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.
> 
> looks like some formatting is off ?

Thanks, Mike. Patch applied.

Cheers,

Michael

> --- a/man5/proc.5
> +++ b/man5/proc.5
> @@ -1525,7 +1525,7 @@ and in that shell we create some new mount points:
>  $ \fBPS1='sh1# ' unshare \-Urnm\fP
>  sh1# \fBmount \-t tmpfs tmpfs /etc\fP  # Mount empty tmpfs at /etc
>  sh1# \fBmount \-\-bind /usr /dev\fP     # Mount /usr at /dev
> -sh1# \fBecho $$
> +sh1# \fBecho $$\fP
>  27123
>  .in
>  .fi
> @@ -1533,10 +1533,10 @@ sh1# \fBecho $$
>  In a second terminal window, in the initial mount namespace,
>  we look at the contents of the corresponding mounts in
>  the initial and new namespaces:
> -    
> +
>  .nf
>  .in +4n
> -$ \fBPS1='sh2# ' sudo sh
> +$ \fBPS1='sh2# ' sudo sh\fP
>  sh2# \fBls /etc | wc \-l\fP                  # In initial NS
>  309
>  sh2# \fBls /proc/27123/root/etc | wc \-l\fP  # /etc in other NS
> 


-- 
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2016-10-07 20:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06  1:36 [PATCH] proc(5): clarify the root symlink and mount namespaces Mike Frysinger
     [not found] ` <20161006013609.17481-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2016-10-06  5:51   ` Michael Kerrisk (man-pages)
     [not found]     ` <f464f3c8-7c76-7288-d3dd-a7d7ffc05a75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-06 17:23       ` Mike Frysinger
2016-10-06 17:23   ` [PATCH v2] " Mike Frysinger
     [not found]     ` <20161006172322.3253-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2016-10-07 12:33       ` Michael Kerrisk (man-pages)
     [not found]         ` <03f48447-e197-fb88-c7fd-ec8c01c38cf7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-07 19:21           ` Mike Frysinger
     [not found]             ` <20161007192100.GY21655-UgUKS2FnFs9+urZeOPWqwQ@public.gmane.org>
2016-10-07 20:50               ` Michael Kerrisk (man-pages) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa5443c2-34a9-b77d-0e13-dc5dba4ca0e8@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).