Skip to content

Commit

Permalink
Upgrade libcontainer to 1d3b2589d734dc94a1719a3af4
Browse files Browse the repository at this point in the history
Correct exit code when dying on a signal (fixes moby#9979).

Signed-off-by: Arnaud Porterie <[email protected]>
  • Loading branch information
Arnaud Porterie committed Jan 13, 2015
1 parent 9b0072a commit 009041c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion project/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ "$1" = '--go' ]; then
mv tmp-tar src/code.google.com/p/go/src/pkg/archive/tar
fi

clone git github.com/docker/libcontainer 6460fd79667466d2d9ec03f77f319a241c58d40b
clone git github.com/docker/libcontainer 1d3b2589d734dc94a1719a3af40b87ed8319f329
# see src/github.com/docker/libcontainer/update-vendor.sh which is the "source of truth" for libcontainer deps (just like this file)
rm -rf src/github.com/docker/libcontainer/vendor
eval "$(grep '^clone ' src/github.com/docker/libcontainer/update-vendor.sh | grep -v 'github.com/codegangsta/cli')"
Expand Down
6 changes: 5 additions & 1 deletion vendor/src/github.com/docker/libcontainer/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ Our goal is to make libcontainer run everywhere, but currently libcontainer requ

## Cross-architecture support

Our goal is to make libcontainer run everywhere. However currently libcontainer only runs on x86_64 systems. We plan on expanding architecture support, so that libcontainer containers can be created and used on more architectures.
Our goal is to make libcontainer run everywhere. Recently libcontainer has
expanded from its initial support for x86_64 systems to include POWER (ppc64
little and big endian variants), IBM System z (s390x 64-bit), and ARM. We plan
to continue expanding architecture support such that libcontainer containers
can be created and used on more architectures.
11 changes: 10 additions & 1 deletion vendor/src/github.com/docker/libcontainer/namespaces/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import (
"github.com/docker/libcontainer/system"
)

const (
EXIT_SIGNAL_OFFSET = 128
)

// TODO(vishh): This is part of the libcontainer API and it does much more than just namespaces related work.
// Move this to libcontainer package.
// Exec performs setup outside of a namespace so that a container can be
Expand Down Expand Up @@ -113,7 +117,12 @@ func Exec(container *libcontainer.Config, stdin io.Reader, stdout, stderr io.Wri
if !container.Namespaces.Contains(libcontainer.NEWPID) {
killAllPids(container)
}
return command.ProcessState.Sys().(syscall.WaitStatus).ExitStatus(), nil

waitStatus := command.ProcessState.Sys().(syscall.WaitStatus)
if waitStatus.Signaled() {
return EXIT_SIGNAL_OFFSET + int(waitStatus.Signal()), nil
}
return waitStatus.ExitStatus(), nil
}

// killAllPids itterates over all of the container's processes
Expand Down
5 changes: 3 additions & 2 deletions vendor/src/github.com/docker/libcontainer/nsinit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ func main() {
app.Before = preload

app.Commands = []cli.Command{
configCommand,
execCommand,
initCommand,
statsCommand,
configCommand,
oomCommand,
pauseCommand,
statsCommand,
unpauseCommand,
}

Expand Down
28 changes: 28 additions & 0 deletions vendor/src/github.com/docker/libcontainer/nsinit/oom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package main

import (
"log"

"github.com/codegangsta/cli"
"github.com/docker/libcontainer"
)

var oomCommand = cli.Command{
Name: "oom",
Usage: "display oom notifications for a container",
Action: oomAction,
}

func oomAction(context *cli.Context) {
state, err := libcontainer.GetState(dataPath)
if err != nil {
log.Fatal(err)
}
n, err := libcontainer.NotifyOnOOM(state)
if err != nil {
log.Fatal(err)
}
for _ = range n {
log.Printf("OOM notification received")
}
}

0 comments on commit 009041c

Please sign in to comment.