diff --git a/linux/linux.go b/linux/linux.go index 92110c4df..8a97b4f65 100644 --- a/linux/linux.go +++ b/linux/linux.go @@ -343,6 +343,10 @@ type libcontainerRuntime struct { factory libcontainer.Factory } +func (r *libcontainerRuntime) Type() string { + return "libcontainer" +} + func (r *libcontainerRuntime) Create(id, bundlePath string, stdio *runtime.Stdio) (runtime.Container, error) { spec, rspec, err := r.loadSpec( filepath.Join(bundlePath, "config.json"), diff --git a/runc/runc.go b/runc/runc.go index 967ddc9fc..ff429cbdb 100644 --- a/runc/runc.go +++ b/runc/runc.go @@ -135,6 +135,10 @@ type runcRuntime struct { stateDir string } +func (r *runcRuntime) Type() string { + return "runc" +} + func (r *runcRuntime) Create(id, bundlePath string, stdio *runtime.Stdio) (runtime.Container, error) { cmd := exec.Command("runc", "--root", r.stateDir, "--id", id, "start") cmd.Dir = bundlePath diff --git a/runtime/runtime.go b/runtime/runtime.go index b92861a94..5a5e0d937 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -17,4 +17,5 @@ var ( type Runtime interface { Create(id, bundlePath string, stdio *Stdio) (Container, error) StartProcess(Container, specs.Process, *Stdio) (Process, error) + Type() string } diff --git a/supervisor.go b/supervisor.go index d411a305d..b3938b2c2 100644 --- a/supervisor.go +++ b/supervisor.go @@ -149,6 +149,10 @@ func (s *Supervisor) Start() error { close(e.Err) } }() + logrus.WithFields(logrus.Fields{ + "runtime": s.runtime.Type(), + "stateDir": s.stateDir, + }).Debug("Supervisor started") return nil }