diff --git a/libcontainer/container.go b/libcontainer/container.go index 7e89422a03d..5c5c6c77d41 100644 --- a/libcontainer/container.go +++ b/libcontainer/container.go @@ -76,13 +76,13 @@ type BaseContainer interface { // // errors: // ContainerDestroyed - Container no longer exists, - // Systemerror - System error. + // SystemError - System error. Status() (Status, error) // State returns the current container's state information. // // errors: - // Systemerror - System error. + // SystemError - System error. State() (*State, error) // Returns the current config of the container. @@ -92,7 +92,7 @@ type BaseContainer interface { // // errors: // ContainerDestroyed - Container no longer exists, - // Systemerror - System error. + // SystemError - System error. // // Some of the returned PIDs may no longer refer to processes in the Container, unless // the Container state is PAUSED in which case every PID in the slice is valid. @@ -102,7 +102,7 @@ type BaseContainer interface { // // errors: // ContainerDestroyed - Container no longer exists, - // Systemerror - System error. + // SystemError - System error. Stats() (*Stats, error) // Set resources of container as configured @@ -110,7 +110,7 @@ type BaseContainer interface { // We can use this to change resources when containers are running. // // errors: - // Systemerror - System error. + // SystemError - System error. Set(config configs.Config) error // Start a process inside the container. Returns error if process fails to @@ -120,7 +120,7 @@ type BaseContainer interface { // ContainerDestroyed - Container no longer exists, // ConfigInvalid - config is invalid, // ContainerPaused - Container is paused, - // Systemerror - System error. + // SystemError - System error. Start(process *Process) (err error) // StartI immediatly starts the process inside the conatiner. Returns error if process @@ -131,7 +131,7 @@ type BaseContainer interface { // ContainerDestroyed - Container no longer exists, // ConfigInvalid - config is invalid, // ContainerPaused - Container is paused, - // Systemerror - System error. + // SystemError - System error. StartI(process *Process) (err error) // Destroys the container after killing all running processes. @@ -140,12 +140,12 @@ type BaseContainer interface { // No error is returned if the container is already destroyed. // // errors: - // Systemerror - System error. + // SystemError - System error. Destroy() error // Signal sends the provided signal code to the container's initial process. // // errors: - // Systemerror - System error. + // SystemError - System error. Signal(s os.Signal) error } diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index 8c9ef4e5bf4..e35161be525 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -31,7 +31,7 @@ const stdioFdCount = 3 // InitContinueSignal is used to signal the container init process to // start the users specified process after the container create has finished. -const InitContinueSignal = syscall.SIGCONT +const InitContinueSignal = syscall.SIGUSR1 type linuxContainer struct { id string @@ -1089,10 +1089,8 @@ func (c *linuxContainer) runType() (Status, error) { return Stopped, newSystemErrorWithCausef(err, "reading /proc/%d/environ", pid) } check := []byte("_LIBCONTAINER") - for _, v := range bytes.Split(environ, []byte("\x00")) { - if bytes.Contains(v, check) { - return Created, nil - } + if bytes.Contains(environ, check) { + return Created, nil } return Running, nil } diff --git a/libcontainer/integration/template_test.go b/libcontainer/integration/template_test.go index 2345dd3506d..f54a849acf6 100644 --- a/libcontainer/integration/template_test.go +++ b/libcontainer/integration/template_test.go @@ -89,14 +89,12 @@ func newTemplateConfig(rootfs string) *configs.Config { Data: "mode=1777,size=65536k", Flags: defaultMountFlags, }, - /* - { - Source: "mqueue", - Destination: "/dev/mqueue", - Device: "mqueue", - Flags: defaultMountFlags, - }, - */ + { + Source: "mqueue", + Destination: "/dev/mqueue", + Device: "mqueue", + Flags: defaultMountFlags, + }, { Source: "sysfs", Destination: "/sys",