]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
cgroup_namespaces.7: In the example shell session, give second shell a different...
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 20 May 2019 19:52:13 +0000 (21:52 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 20 May 2019 19:55:01 +0000 (21:55 +0200)
Give the shell in the second cgroup namespace a different prompt,
so as to clearly distinguish the two namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man7/cgroup_namespaces.7

index 42c70f7c5ace2de5fa605d01561ccec87adec264..a1f8d1073c0f3bbc54ed52519a4b6f8e6974d33b 100644 (file)
@@ -104,7 +104,7 @@ to create a process running a new shell in new cgroup and mount namespaces:
 .PP
 .EX
 .in +4n
-# \fBunshare \-Cm bash\fP
+# \fBPS1="sh2# " unshare \-Cm bash\fP
 .in
 .EE
 .PP
@@ -120,11 +120,11 @@ with PID 1), and the process in the sibling cgroup
 .PP
 .EX
 .in +4n
-# \fBcat /proc/self/cgroup | grep freezer\fP
+sh2# \fBcat /proc/self/cgroup | grep freezer\fP
 7:freezer:/
-# \fBcat /proc/1/cgroup | grep freezer\fP
+sh2# \fBcat /proc/1/cgroup | grep freezer\fP
 7:freezer:/..
-# \fBcat /proc/20124/cgroup | grep freezer\fP
+sh2# \fBcat /proc/20124/cgroup | grep freezer\fP
 7:freezer:/../sub2
 .in
 .EE
@@ -149,7 +149,7 @@ we see the following anomaly:
 .PP
 .EX
 .in +4n
-# \fBcat /proc/self/mountinfo | grep freezer\fP
+sh2# \fBcat /proc/self/mountinfo | grep freezer\fP
 155 145 0:32 /.. /sys/fs/cgroup/freezer ...
 .in
 .EE
@@ -171,11 +171,11 @@ new cgroup namespace), after which we see the expected results:
 .PP
 .EX
 .in +4n
-# \fBmount \-\-make\-rslave /\fP     # Don't propagate mount events
-                            # to other namespaces
-# \fBumount /sys/fs/cgroup/freezer\fP
-# \fBmount \-t cgroup \-o freezer freezer /sys/fs/cgroup/freezer\fP
-# \fBcat /proc/self/mountinfo | grep freezer\fP
+sh2# \fBmount \-\-make\-rslave /\fP     # Don't propagate mount events
+                               # to other namespaces
+sh2# \fBumount /sys/fs/cgroup/freezer\fP
+sh2# \fBmount \-t cgroup \-o freezer freezer /sys/fs/cgroup/freezer\fP
+sh2# \fBcat /proc/self/mountinfo | grep freezer\fP
 155 145 0:32 / /sys/fs/cgroup/freezer rw,relatime ...
 .in
 .EE