aboutsummaryrefslogtreecommitdiffstats
path: root/man2/pivot_root.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/pivot_root.2')
-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