From f413e4b11794cd71cc3b2b64c8f6861f5394a3f1 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Thu, 11 Oct 2018 11:55:45 -0700 Subject: Add bare bones unsupported syscall logging This change introduces a new flags to create/run called --user-log. Logs to this files are visible to users and are meant to help debugging problems with their images and containers. For now only unsupported syscalls are sent to this log, and only minimum support was added. We can build more infrastructure around it as needed. PiperOrigin-RevId: 216735977 Change-Id: I54427ca194604991c407d49943ab3680470de2d0 --- runsc/cmd/boot.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runsc/cmd/boot.go') diff --git a/runsc/cmd/boot.go b/runsc/cmd/boot.go index d26e92bcd..023b63dc0 100644 --- a/runsc/cmd/boot.go +++ b/runsc/cmd/boot.go @@ -66,6 +66,9 @@ type Boot struct { // totalMem sets the initial amount of total memory to report back to the // container. totalMem uint64 + + // userLogFD is the file descriptor to write user logs to. + userLogFD int } // Name implements subcommands.Command.Name. @@ -95,6 +98,7 @@ func (b *Boot) SetFlags(f *flag.FlagSet) { f.BoolVar(&b.applyCaps, "apply-caps", false, "if true, apply capabilities defined in the spec to the process") 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.") } // Execute implements subcommands.Command.Execute. It starts a sandbox in a @@ -163,6 +167,7 @@ func (b *Boot) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) Console: b.console, NumCPU: b.cpuNum, TotalMem: b.totalMem, + UserLogFD: b.userLogFD, } l, err := boot.New(bootArgs) if err != nil { -- cgit v1.2.3