mirror of https://github.com/mkerrisk/man-pages
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>
This commit is contained in:
parent
727e560920
commit
f3da99c4ee
|
@ -104,7 +104,7 @@ to create a process running a new shell in new cgroup and mount namespaces:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
.in +4n
|
.in +4n
|
||||||
# \fBunshare \-Cm bash\fP
|
# \fBPS1="sh2# " unshare \-Cm bash\fP
|
||||||
.in
|
.in
|
||||||
.EE
|
.EE
|
||||||
.PP
|
.PP
|
||||||
|
@ -120,11 +120,11 @@ with PID 1), and the process in the sibling cgroup
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
.in +4n
|
.in +4n
|
||||||
# \fBcat /proc/self/cgroup | grep freezer\fP
|
sh2# \fBcat /proc/self/cgroup | grep freezer\fP
|
||||||
7:freezer:/
|
7:freezer:/
|
||||||
# \fBcat /proc/1/cgroup | grep freezer\fP
|
sh2# \fBcat /proc/1/cgroup | grep freezer\fP
|
||||||
7:freezer:/..
|
7:freezer:/..
|
||||||
# \fBcat /proc/20124/cgroup | grep freezer\fP
|
sh2# \fBcat /proc/20124/cgroup | grep freezer\fP
|
||||||
7:freezer:/../sub2
|
7:freezer:/../sub2
|
||||||
.in
|
.in
|
||||||
.EE
|
.EE
|
||||||
|
@ -149,7 +149,7 @@ we see the following anomaly:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
.in +4n
|
.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 ...
|
155 145 0:32 /.. /sys/fs/cgroup/freezer ...
|
||||||
.in
|
.in
|
||||||
.EE
|
.EE
|
||||||
|
@ -171,11 +171,11 @@ new cgroup namespace), after which we see the expected results:
|
||||||
.PP
|
.PP
|
||||||
.EX
|
.EX
|
||||||
.in +4n
|
.in +4n
|
||||||
# \fBmount \-\-make\-rslave /\fP # Don't propagate mount events
|
sh2# \fBmount \-\-make\-rslave /\fP # Don't propagate mount events
|
||||||
# to other namespaces
|
# to other namespaces
|
||||||
# \fBumount /sys/fs/cgroup/freezer\fP
|
sh2# \fBumount /sys/fs/cgroup/freezer\fP
|
||||||
# \fBmount \-t cgroup \-o freezer freezer /sys/fs/cgroup/freezer\fP
|
sh2# \fBmount \-t cgroup \-o freezer freezer /sys/fs/cgroup/freezer\fP
|
||||||
# \fBcat /proc/self/mountinfo | grep freezer\fP
|
sh2# \fBcat /proc/self/mountinfo | grep freezer\fP
|
||||||
155 145 0:32 / /sys/fs/cgroup/freezer rw,relatime ...
|
155 145 0:32 / /sys/fs/cgroup/freezer rw,relatime ...
|
||||||
.in
|
.in
|
||||||
.EE
|
.EE
|
||||||
|
|
Loading…
Reference in New Issue