Bump init and containerd packages to v1.0.0-alpha6

Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
Ian Campbell
2017-08-18 21:00:13 +01:00
parent 6d878dd65f
commit b0b08e18a2
4 changed files with 30 additions and 10 deletions

View File

@@ -55,6 +55,24 @@ func startCmd(args []string) {
log.Debugf("Started %s pid %d", id, pid)
}
type cio struct {
config containerd.IOConfig
}
func (c *cio) Config() containerd.IOConfig {
return c.config
}
func (c *cio) Cancel() {
}
func (c *cio) Wait() {
}
func (c *cio) Close() error {
return nil
}
func start(service, sock, basePath, dumpSpec string) (string, uint32, string, error) {
path := filepath.Join(basePath, service)
@@ -102,18 +120,20 @@ func start(service, sock, basePath, dumpSpec string) (string, uint32, string, er
return "", 0, "failed to create container", err
}
io := func(id string) (*containerd.IO, error) {
io := func(id string) (containerd.IO, error) {
logfile := filepath.Join("/var/log", service+".log")
// We just need this to exist.
if err := ioutil.WriteFile(logfile, []byte{}, 0600); err != nil {
// if we cannot write to log, discard output
logfile = "/dev/null"
}
return &containerd.IO{
Stdin: "/dev/null",
Stdout: logfile,
Stderr: logfile,
Terminal: false,
return &cio{
containerd.IOConfig{
Stdin: "/dev/null",
Stdout: logfile,
Stderr: logfile,
Terminal: false,
},
}, nil
}