aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2019-07-30 13:47:12 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2019-09-23 13:11:19 +0200
commitfc2f474d77fbe64283ea233508bc86bb1b45e892 (patch)
tree80c0c9a86a59482c71430a04efa9175a3eee10bd
parentb647c4c93a4fb4c21617d8dbb705d9ab14a8d6e5 (diff)
downloadman-pages-fc2f474d77fbe64283ea233508bc86bb1b45e892.tar.gz
pivot_root.2: Relocate details about kernel threads to NOTES
This text is a side point that somewhat distracts from the flow in DESCRIPTION. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/pivot_root.222
1 files changed, 14 insertions, 8 deletions
diff --git a/man2/pivot_root.2 b/man2/pivot_root.2
index 3e16b430e9..3845e5f24d 100644
--- a/man2/pivot_root.2
+++ b/man2/pivot_root.2
@@ -52,14 +52,7 @@ changes the root directory and the current working directory
of each process or thread in the same mount namespace to
.I new_root
if they point to the old root directory.
-This is necessary in order to prevent kernel threads from keeping the old
-root directory busy with their root and current working directory,
-even if they never access
-the filesystem in any way.
-Perhaps one day there may be a mechanism for
-kernel threads to explicitly relinquish any access to the filesystem,
-such that this fairly intrusive mechanism can be removed from
-.BR pivot_root ().
+See also NOTES.
.PP
Note that this also applies to the calling process:
.BR pivot_root ()
@@ -195,6 +188,19 @@ the current root of all relevant processes or threads.
A modern use is to set up a root filesystem during
the creation of a container.
.PP
+The fact that
+.BR pivot_root ()
+modifies process root and current working directories in the
+manner noted in DESCRIPTION
+is necessary in order to prevent kernel threads from keeping the old
+root directory busy with their root and current working directory,
+even if they never access
+the filesystem in any way.
+Perhaps one day there may be a mechanism for
+kernel threads to explicitly relinquish any access to the filesystem,
+such that this fairly intrusive mechanism can be removed from
+.BR pivot_root ().
+.PP
The rootfs (initial ramfs) cannot be
.BR pivot_root ()ed.
The recommended method of changing the root filesystem in this case is