Add stderr log ouput if in debug
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
f7eec3dd13
commit
9183242a5d
3 changed files with 4 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
||||||
package nsinit
|
package nsinit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"github.com/dotcloud/docker/pkg/libcontainer"
|
"github.com/dotcloud/docker/pkg/libcontainer"
|
||||||
"github.com/dotcloud/docker/pkg/system"
|
"github.com/dotcloud/docker/pkg/system"
|
||||||
"os"
|
"os"
|
||||||
|
@ -26,7 +25,7 @@ func (c *DefaultCommandFactory) Create(container *libcontainer.Container, consol
|
||||||
// get our binary name from arg0 so we can always reexec ourself
|
// get our binary name from arg0 so we can always reexec ourself
|
||||||
command := exec.Command(os.Args[0], append([]string{
|
command := exec.Command(os.Args[0], append([]string{
|
||||||
"-console", console,
|
"-console", console,
|
||||||
"-pipe", fmt.Sprint(pipe.Fd()),
|
"-pipe", "3",
|
||||||
"-root", c.Root,
|
"-root", c.Root,
|
||||||
"init"}, args...)...)
|
"init"}, args...)...)
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ func (ns *linuxNs) Exec(container *libcontainer.Container, term Terminal, args [
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
|
ns.logger.Printf("created sync pipe parent fd %d child fd %d\n", syncPipe.parent.Fd(), syncPipe.child.Fd())
|
||||||
|
|
||||||
if container.Tty {
|
if container.Tty {
|
||||||
ns.logger.Println("creating master and console")
|
ns.logger.Println("creating master and console")
|
||||||
|
|
|
@ -24,6 +24,7 @@ func (ns *linuxNs) Init(container *libcontainer.Container, uncleanRootfs, consol
|
||||||
}
|
}
|
||||||
|
|
||||||
// We always read this as it is a way to sync with the parent as well
|
// We always read this as it is a way to sync with the parent as well
|
||||||
|
ns.logger.Printf("reading from sync pipe fd %d\n", syncPipe.child.Fd())
|
||||||
context, err := syncPipe.ReadFromParent()
|
context, err := syncPipe.ReadFromParent()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
syncPipe.Close()
|
syncPipe.Close()
|
||||||
|
@ -68,7 +69,7 @@ func (ns *linuxNs) Init(container *libcontainer.Container, uncleanRootfs, consol
|
||||||
}
|
}
|
||||||
|
|
||||||
if profile := container.Context["apparmor_profile"]; profile != "" {
|
if profile := container.Context["apparmor_profile"]; profile != "" {
|
||||||
ns.logger.Printf("setting apparmor prifile %s\n", profile)
|
ns.logger.Printf("setting apparmor profile %s\n", profile)
|
||||||
if err := apparmor.ApplyProfile(os.Getpid(), profile); err != nil {
|
if err := apparmor.ApplyProfile(os.Getpid(), profile); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue