]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/unshare.1
lsblk: fix -D segfault
[thirdparty/util-linux.git] / sys-utils / unshare.1
CommitLineData
4205f1fd
MG
1.\" Process this file with
2.\" groff -man -Tascii lscpu.1
3.\"
87ec43b6 4.TH UNSHARE 1 "July 2013" "util-linux" "User Commands"
4205f1fd 5.SH NAME
ef6acdb8 6unshare \- run program with some namespaces unshared from parent
4205f1fd
MG
7.SH SYNOPSIS
8.B unshare
87ec43b6 9.RI [ options ]
dde08a87 10.I program
4205f1fd
MG
11.RI [ arguments ]
12.SH DESCRIPTION
dde08a87 13Unshares the indicated namespaces from the parent process and then executes
87ec43b6
BS
14the specified program. The namespaces to be unshared are indicated via
15options. Unshareable namespaces are:
4205f1fd
MG
16.TP
17.BR "mount namespace"
dde08a87 18Mounting and unmounting filesystems will not affect the rest of the system
bc87f885 19(\fBCLONE_NEWNS\fP flag), except for filesystems which are explicitly marked as
dde08a87
BS
20shared (with \fBmount --make-shared\fP; see \fI/proc/self/mountinfo\fP for the
21\fBshared\fP flags).
4205f1fd
MG
22.TP
23.BR "UTS namespace"
dde08a87
BS
24Setting hostname or domainname will not affect the rest of the system.
25(\fBCLONE_NEWUTS\fP flag)
4205f1fd
MG
26.TP
27.BR "IPC namespace"
dde08a87
BS
28The process will have an independent namespace for System V message queues,
29semaphore sets and shared memory segments. (\fBCLONE_NEWIPC\fP flag)
4205f1fd
MG
30.TP
31.BR "network namespace"
dde08a87
BS
32The process will have independent IPv4 and IPv6 stacks, IP routing tables,
33firewall rules, the \fI/proc/net\fP and \fI/sys/class/net\fP directory trees,
34sockets, etc. (\fBCLONE_NEWNET\fP flag)
4205f1fd 35.TP
bc7f9b95 36.BR "pid namespace"
dde08a87
BS
37Children will have a distinct set of PID to process mappings from their parent.
38(\fBCLONE_NEWPID\fP flag)
bc7f9b95
EB
39.TP
40.BR "user namespace"
dde08a87
BS
41The process will have a distinct set of UIDs, GIDs and capabilities.
42(\fBCLONE_NEWUSER\fP flag)
e41e0f95 43.PP
dde08a87 44See \fBclone\fR(2) for the exact semantics of the flags.
4205f1fd
MG
45.SH OPTIONS
46.TP
47.BR \-h , " \-\-help"
b4362b6f 48Display help text and exit.
4205f1fd 49.TP
ef6acdb8 50.BR \-i , " \-\-ipc"
dde08a87
BS
51Unshare the IPC namespace.
52.TP
53.BR \-m , " \-\-mount"
54Unshare the mount namespace.
4205f1fd 55.TP
ef6acdb8
KZ
56.BR \-n , " \-\-net"
57Unshare the network namespace.
bc7f9b95
EB
58.TP
59.BR \-p , " \-\-pid"
87ec43b6
BS
60Unshare the pid namespace.
61See also the \fB--fork\fP and \fB--mount-proc\fP options.
bc7f9b95 62.TP
dde08a87
BS
63.BR \-u , " \-\-uts"
64Unshare the UTS namespace.
65.TP
bc7f9b95
EB
66.BR \-U , " \-\-user"
67Unshare the user namespace.
5088ec33
MF
68.TP
69.BR \-f , " \-\-fork"
87ec43b6
BS
70Fork the specified \fIprogram\fR as a child process of \fBunshare\fR rather than
71running it directly. This is useful when creating a new pid namespace.
6728ca10 72.TP
87ec43b6 73.BR \-\-mount-proc "[=\fImountpoint\fP]"
6728ca10
KZ
74Just before running the program, mount the proc filesystem at the \fImountpoint\fP
75(default is /proc). This is useful when creating a new pid namespace. It also
76implies creating a new mount namespace since the /proc mount would otherwise
77mess up existing programs on the system.
4205f1fd 78.SH SEE ALSO
8323d9fd
MF
79.BR unshare (2),
80.BR clone (2)
4205f1fd
MG
81.SH BUGS
82None known so far.
ef6acdb8 83.SH AUTHOR
4205f1fd
MG
84Mikhail Gusarov <dottedmag@dottedmag.net>
85.SH AVAILABILITY
601d12fb
KZ
86The unshare command is part of the util-linux package and is available from
87ftp://ftp.kernel.org/pub/linux/utils/util-linux/.