Add concurrency and id flag for daemon

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2015-12-07 15:19:56 -08:00
parent 9415a4210c
commit d9e8fe62cb
5 changed files with 40 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ package containerd
import (
"os"
"os/signal"
"path/filepath"
goruntime "runtime"
"sync"
"syscall"
@@ -13,16 +14,16 @@ import (
)
// NewSupervisor returns an initialized Process supervisor.
func NewSupervisor(stateDir string, tasks chan *StartTask) (*Supervisor, error) {
func NewSupervisor(id, stateDir string, tasks chan *StartTask) (*Supervisor, error) {
if err := os.MkdirAll(stateDir, 0755); err != nil {
return nil, err
}
// register counters
r, err := newRuntime(stateDir)
r, err := newRuntime(filepath.Join(stateDir, id))
if err != nil {
return nil, err
}
machine, err := CollectMachineInformation()
machine, err := CollectMachineInformation(id)
if err != nil {
return nil, err
}