Merge pull request #1858 from marcov/nsenter-README

Update outdated nsenter README content
This commit is contained in:
Michael Crosby 2018-09-17 10:53:19 -04:00 committed by GitHub
commit cc8146cf93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -10,8 +10,8 @@ The `nsenter` package will `import "C"` and it uses [cgo](https://golang.org/cmd
package. In cgo, if the import of "C" is immediately preceded by a comment, that comment, package. In cgo, if the import of "C" is immediately preceded by a comment, that comment,
called the preamble, is used as a header when compiling the C parts of the package. called the preamble, is used as a header when compiling the C parts of the package.
So every time we import package `nsenter`, the C code function `nsexec()` would be So every time we import package `nsenter`, the C code function `nsexec()` would be
called. And package `nsenter` is now only imported in `main_unix.go`, so every time called. And package `nsenter` is only imported in `init.go`, so every time the runc
before we call `cmd.Start` on linux, that C code would run. `init` command is invoked, that C code is run.
Because `nsexec()` must be run before the Go runtime in order to use the Because `nsexec()` must be run before the Go runtime in order to use the
Linux kernel namespace, you must `import` this library into a package if Linux kernel namespace, you must `import` this library into a package if
@ -37,7 +37,7 @@ the parent `nsexec()` will exit and the child `nsexec()` process will
return to allow the Go runtime take over. return to allow the Go runtime take over.
NOTE: We do both `setns(2)` and `clone(2)` even if we don't have any NOTE: We do both `setns(2)` and `clone(2)` even if we don't have any
CLONE_NEW* clone flags because we must fork a new process in order to `CLONE_NEW*` clone flags because we must fork a new process in order to
enter the PID namespace. enter the PID namespace.