aboutsummaryrefslogtreecommitdiffstats
path: root/man7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2019-05-20 21:52:13 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2019-05-20 21:55:01 +0200
commitf3da99c4eec54028b41879216e9540a6f1f3965e (patch)
tree4d427d8c33473cd030a21279c792e8d3248ee7d0 /man7
parent727e560920b7ef81ae5cae6c241066722535b6da (diff)
downloadman-pages-f3da99c4eec54028b41879216e9540a6f1f3965e.tar.gz
cgroup_namespaces.7: In the example shell session, give second shell a different prompt
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>
Diffstat (limited to 'man7')
-rw-r--r--man7/cgroup_namespaces.720
1 files changed, 10 insertions, 10 deletions
diff --git a/man7/cgroup_namespaces.7 b/man7/cgroup_namespaces.7
index 42c70f7c5a..a1f8d1073c 100644
--- a/man7/cgroup_namespaces.7
+++ b/man7/cgroup_namespaces.7
@@ -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