diff options
author | Andrei Vagin <avagin@google.com> | 2019-01-18 12:16:24 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-01-18 12:17:34 -0800 |
commit | c063a1350f4ac6249fb26e6125c9cc99db14263b (patch) | |
tree | b96361cb0b81c81e9af7f3f61ddc65e0469349ab /runsc/cmd/boot.go | |
parent | 8d7c10e90840cfecf53089e7cc3507cac2804fd1 (diff) |
runsc: create a new proc mount if the sandbox process is running in a new pidns
PiperOrigin-RevId: 229971902
Change-Id: Ief4fac731e839ef092175908de9375d725eaa3aa
Diffstat (limited to 'runsc/cmd/boot.go')
-rw-r--r-- | runsc/cmd/boot.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runsc/cmd/boot.go b/runsc/cmd/boot.go index 7ca2744bd..fb1fd3e70 100644 --- a/runsc/cmd/boot.go +++ b/runsc/cmd/boot.go @@ -75,6 +75,9 @@ type Boot struct { // startSyncFD is the file descriptor to synchronize runsc and sandbox. startSyncFD int + + // pidns is set if the sanadbox is in its own pid namespace. + pidns bool } // Name implements subcommands.Command.Name. @@ -103,6 +106,7 @@ func (b *Boot) SetFlags(f *flag.FlagSet) { f.BoolVar(&b.console, "console", false, "set to true if the sandbox should allow terminal ioctl(2) syscalls") f.BoolVar(&b.applyCaps, "apply-caps", false, "if true, apply capabilities defined in the spec to the process") f.BoolVar(&b.setUpRoot, "setup-root", false, "if true, set up an empty root for the process") + f.BoolVar(&b.pidns, "pidns", false, "if true, the sandbox is in its own PID namespace") f.IntVar(&b.cpuNum, "cpu-num", 0, "number of CPUs to create inside the sandbox") f.Uint64Var(&b.totalMem, "total-memory", 0, "sets the initial amount of total memory to report back to the container") f.IntVar(&b.userLogFD, "user-log-fd", 0, "file descriptor to write user logs to. 0 means no logging.") @@ -121,7 +125,7 @@ func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) debug.SetTraceback("all") if b.setUpRoot { - if err := setUpChroot(); err != nil { + if err := setUpChroot(b.pidns); err != nil { Fatalf("error setting up chroot: %v", err) } |