]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Manual pages: unshare.1: improve intro paragraphs
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 23 May 2020 06:43:20 +0000 (08:43 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 25 May 2020 12:16:45 +0000 (14:16 +0200)
The intro paragraphs of this page are rather hard for a newcomer to
grok. The name of the underlying system call (and consequently the
name of the command) are "strange", but let's help the reader by
naming more clearly what unshare(1) does: creating new namespaces. In
addition, clarify and expand the details on making a namespace
persistent using bind mounts.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
sys-utils/unshare.1

index fb769d6073d84ed3972fc930669c4dd26791bf3c..14b107d378218c29eb0afbdf54f8e35676cb2b90 100644 (file)
@@ -1,30 +1,41 @@
 .TH UNSHARE 1 "February 2016" "util-linux" "User Commands"
 .SH NAME
-unshare \- run program with some namespaces unshared from parent
+unshare \- run program in new namespaces
 .SH SYNOPSIS
 .B unshare
 [options]
 .RI [ program
 .RI [ arguments ]]
 .SH DESCRIPTION
-Unshares the indicated namespaces from the parent process and then executes
-the specified \fIprogram\fR. If \fIprogram\fR is not given, then ``${SHELL}'' is
+The
+.B unshare
+command creates new namespaces
+(as specified by the command-line options described below)
+and then executes the specified \fIprogram\fR.
+If \fIprogram\fR is not given, then ``${SHELL}'' is
 run (default: /bin/sh).
 .PP
-The namespaces can optionally be made persistent by bind mounting
-/proc/\fIpid\fR/ns/\fItype\fR files to a filesystem path and entered with
+By default, a new namespace persists only as long as it has member processes.
+A new namespace can be made persistent even when it has no member processes
+by bind mounting
+/proc/\fIpid\fR/ns/\fItype\fR files to a filesystem path.
+A namespace that has been made persistent in this was can subsequently
+be entered with
 .BR \%nsenter (1)
 even after the \fIprogram\fR terminates (except PID namespaces where
-permanently running init process is required).
-Once a persistent \%namespace is no longer needed, it can be unpersisted with
-.BR umount (8).
+a permanently running init process is required).
+Once a persistent \%namespace is no longer needed,
+it can be unpersisted by using
+.BR umount (8)
+to remove the bind mount.
 See the \fBEXAMPLE\fR section for more details.
 .PP
 .B unshare
 since util-linux version 2.36 uses /\fIproc/[pid]/ns/pid_for_children\fP and \fI/proc/[pid]/ns/time_for_children\fP
 files for persistent PID and TIME namespaces. This change requires Linux kernel 4.17 or newer.
 .PP
-The namespaces to be unshared are indicated via options.  Unshareable namespaces are:
+The following types of namespaces can be created with
+.BR unshare :
 .TP
 .B mount namespace
 Mounting and unmounting filesystems will not affect the rest of the system,