All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] proc(5): clarify the root symlink and mount namespaces
@ 2016-10-06  1:36 Mike Frysinger
       [not found] ` <20161006013609.17481-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2016-10-06  1:36 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

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
17168

/* Terminal 2 */

Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] proc(5): clarify the root symlink and mount namespaces
       [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   ` [PATCH v2] " Mike Frysinger
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2016-10-06  5:51 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hi Mike,

On 10/06/2016 03:36 AM, 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
> 17168
> 
> /* Terminal 2 */

Your example appears to have been truncated. It'd be nice to have the
complete example for the commit message. Could you send that? 

Thanks,

Michael


> Signed-off-by: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> ---
>  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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] proc(5): clarify the root symlink and mount namespaces
       [not found] ` <20161006013609.17481-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  2016-10-06  5:51   ` Michael Kerrisk (man-pages)
@ 2016-10-06 17:23   ` Mike Frysinger
       [not found]     ` <20161006172322.3253-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2016-10-06 17:23 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

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 <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
---
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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] proc(5): clarify the root symlink and mount namespaces
       [not found]     ` <f464f3c8-7c76-7288-d3dd-a7d7ffc05a75-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-10-06 17:23       ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2016-10-06 17:23 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On 06 Oct 2016 07:51, Michael Kerrisk (man-pages) wrote:
> On 10/06/2016 03:36 AM, 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
> > 17168
> > 
> > /* Terminal 2 */
> 
> Your example appears to have been truncated. It'd be nice to have the
> complete example for the commit message. Could you send that? 

blah, i sometimes forget that git eats lines that start with a #,
so trying to use that as your root prompt messes things up.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] proc(5): clarify the root symlink and mount namespaces
       [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>
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2016-10-07 12:33 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] proc(5): clarify the root symlink and mount namespaces
       [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>
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Frysinger @ 2016-10-07 19:21 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]

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 ?
-mike

--- 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] proc(5): clarify the root symlink and mount namespaces
       [not found]             ` <20161007192100.GY21655-UgUKS2FnFs9+urZeOPWqwQ@public.gmane.org>
@ 2016-10-07 20:50               ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk (man-pages) @ 2016-10-07 20:50 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-07 20:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.