Untie is a small tool used to create namespaces and lauch processes in them. It uses Linux’s virtualization features. Basically it allows to call clone(2) with any flag as parameter. Note that superuser privileges are needed to create namespaces.
Here is a sample usage with the mount namespace:
[root ~]# untie -h
untie 0.3
Usage: untie [OPTIONS]... [COMMAND]...
-h, --help Print help and exit
-V, --version Print version and exit
--mount New mount namespace (default=off)
--uname New uname (default=off)
--ipc New IPC context (default=off)
--mask=MASK Pass user defined flag
--chroot=DIRECTORY Chroot in the specified directory
--uid=UID Change to the specified UID
--username=USERNAME Change to the specified username
--gid=GID Add the specified GID
--groupname=GROUP Add the specified group
--daemonize Run as daemon (default=off)
--alarm=SECONDS Set an alarm after the specified delay
--nice=NICE Run as the specified nice level
--sched=SCHED Use the specified (possibly RT) scheduling policy
--schedprio=PRIO Set the priority according to the given scheduler
[root ~]# mkdir dir1 dir2
[root ~]# touch dir1/file1 dir2/file2
[root ~]# untie --mount
A new shell has been spawned by untie
[root ~]# mount --bind dir1 dir2
[root ~]# ls dir1 dir2
dir1:
file1
dir2:
file1
[root ~]# exit
Back to the original namespace
[root ~]# ls dir1 dir2
dir1:
file1
dir2:
file2
[root ~]#
In this "demo" a new mount namespace is created and a bind mount is made in this new namespace. This mount is invisible to other namespaces. Leaving the namespace destroys it and cancels the mount.