Version: v0.0.0-...-ed07a65 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0



Disassociate parts of the process execution context.


unshare [OPTIONS] [PROGRAM [ARGS]...]


Go applications use multiple processes, and the Go user level scheduler
schedules goroutines onto those processes. For this reason, it is not
possible to use syscall.Unshare. A goroutine can call `syscall.Unshare`
from process m and the scheduler can resume that goroutine in process n,
which has not had the unshare operation! This is a known problem with
any system call that modifies the name space or file system context of
only one process as opposed to the entire Go application, i.e. all of
its processes. Examples include chroot and unshare. There has been
lively discussion of this problem but no resolution as of yet. In sum:
it is not possible to use `syscall.Unshare` from Go with any reasonable
expectation of success.

If PROGRAM is not specified, unshare defaults to /ubin/elvish.


-ipc:           Unshare the IPC namespace
-mount:         Unshare the mount namespace
-pid:           Unshare the pid namespace
-net:           Unshare the net namespace
-uts:           Unshare the uts namespace
-user:          Unshare the user namespace
-map-root-user: Map current uid to root. Not working

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL