Skip to content

Commit

Permalink
Remove lxc driver
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
  • Loading branch information
alexlarsson committed May 14, 2014
1 parent cb0f2a2 commit 1d8f87e
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 1,046 deletions.
26 changes: 10 additions & 16 deletions daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/execdriver/execdrivers"
"github.com/dotcloud/docker/daemon/execdriver/lxc"
"github.com/dotcloud/docker/daemon/graphdriver"
_ "github.com/dotcloud/docker/daemon/graphdriver/vfs"
_ "github.com/dotcloud/docker/daemon/networkdriver/bridge"
Expand Down Expand Up @@ -176,22 +175,17 @@ func (daemon *Daemon) Register(container *Container) error {
existingPid := container.State.Pid
container.State.SetStopped(0)

// We only have to handle this for lxc because the other drivers will ensure that
// no processes are left when docker dies
if container.ExecDriver == "" || strings.Contains(container.ExecDriver, "lxc") {
lxc.KillLxc(container.ID, 9)
} else {
// use the current driver and ensure that the container is dead x.x
cmd := &execdriver.Command{
ID: container.ID,
}
var err error
cmd.Process, err = os.FindProcess(existingPid)
if err != nil {
utils.Debugf("cannot find existing process for %d", existingPid)
}
daemon.execDriver.Terminate(cmd)
// use the current driver and ensure that the container is dead x.x
cmd := &execdriver.Command{
ID: container.ID,
}
var err error
cmd.Process, err = os.FindProcess(existingPid)
if err != nil {
utils.Debugf("cannot find existing process for %d", existingPid)
}
daemon.execDriver.Terminate(cmd)

if err := container.Unmount(); err != nil {
utils.Debugf("unmount error %s", err)
}
Expand Down
6 changes: 0 additions & 6 deletions daemon/execdriver/execdrivers/execdrivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ package execdrivers
import (
"fmt"
"github.com/dotcloud/docker/daemon/execdriver"
"github.com/dotcloud/docker/daemon/execdriver/lxc"
"github.com/dotcloud/docker/daemon/execdriver/native"
"github.com/dotcloud/docker/pkg/sysinfo"
"path"
)

func NewDriver(name, root, initPath string, sysInfo *sysinfo.SysInfo) (execdriver.Driver, error) {
switch name {
case "lxc":

This comment has been minimized.

Copy link
@mattn

mattn May 27, 2014

Is this switch statement needed for future?

This comment has been minimized.

Copy link
@alexlarsson

alexlarsson May 28, 2014

Author Owner

yes, if we ever will have more than one exec driver.

// we want to five the lxc driver the full docker root because it needs
// to access and write config and template files in /var/lib/docker/containers/*
// to be backwards compatible
return lxc.NewDriver(root, sysInfo.AppArmor)
case "native":
return native.NewDriver(path.Join(root, "execdriver", "native"), initPath)
}
Expand Down
Loading

0 comments on commit 1d8f87e

Please sign in to comment.