Merge pull request #690 from crosbymichael/lock-thread

Move lockthread to package level
This commit is contained in:
Mrunal Patel 2016-03-25 17:43:22 -07:00
commit 9d2d88ca8a
1 changed files with 7 additions and 2 deletions

View File

@ -85,12 +85,17 @@ command(s) that get executed on start, edit the args parameter of the spec. See
},
}
func init() {
if len(os.Args) > 1 && os.Args[1] == "init" {
runtime.GOMAXPROCS(1)
runtime.LockOSThread()
}
}
var initCommand = cli.Command{
Name: "init",
Usage: `initialize the namespaces and launch the process (do not call it outside of runc)`,
Action: func(context *cli.Context) {
runtime.GOMAXPROCS(1)
runtime.LockOSThread()
factory, _ := libcontainer.New("")
if err := factory.StartInitialization(); err != nil {
// as the error is sent back to the parent there is no need to log