Use argv0 as reexec implementation for dockerinit

This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 73210671764fc3de133a627205582e069e1ff43d
Component: engine
This commit is contained in:
Michael Crosby
2014-08-08 13:18:18 -07:00
parent 349e2e4036
commit 2fbe59b1d9
13 changed files with 208 additions and 185 deletions

View File

@ -1,11 +1,12 @@
package main
import (
"github.com/docker/docker/sysinit"
_ "github.com/docker/docker/daemon/execdriver/lxc"
_ "github.com/docker/docker/daemon/execdriver/native"
"github.com/docker/docker/reexec"
)
func main() {
// Running in init mode
sysinit.SysInit()
return
reexec.Init()
}