Add logging for started supervisor

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-12-08 09:37:31 -08:00
parent d9e8fe62cb
commit 9f5caf529c
4 changed files with 13 additions and 0 deletions

View file

@ -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"),

View file

@ -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

View file

@ -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
}

View file

@ -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
}