Merge pull request #7490 from crosbymichael/reexec
Use argv0 as reexec implementation for dockerinit Upstream-commit: 01995ebebb3f26a2bd1e1131b5794e8b6b6ae18e Component: engine
This commit is contained in:
@ -8,10 +8,6 @@ import (
|
||||
|
||||
const CanDaemon = false
|
||||
|
||||
func mainSysinit() {
|
||||
log.Fatal("This is a client-only binary - running it as 'dockerinit' is not supported.")
|
||||
}
|
||||
|
||||
func mainDaemon() {
|
||||
log.Fatal("This is a client-only binary - running the Docker daemon is not supported.")
|
||||
}
|
||||
|
||||
@ -7,20 +7,16 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/docker/docker/builtins"
|
||||
_ "github.com/docker/docker/daemon/execdriver/lxc"
|
||||
_ "github.com/docker/docker/daemon/execdriver/native"
|
||||
"github.com/docker/docker/dockerversion"
|
||||
"github.com/docker/docker/engine"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/pkg/signal"
|
||||
"github.com/docker/docker/sysinit"
|
||||
)
|
||||
|
||||
const CanDaemon = true
|
||||
|
||||
func mainSysinit() {
|
||||
// Running in init mode
|
||||
sysinit.SysInit()
|
||||
}
|
||||
|
||||
func mainDaemon() {
|
||||
if flag.NArg() != 0 {
|
||||
flag.Usage()
|
||||
|
||||
@ -13,6 +13,7 @@ import (
|
||||
"github.com/docker/docker/api/client"
|
||||
"github.com/docker/docker/dockerversion"
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
"github.com/docker/docker/reexec"
|
||||
"github.com/docker/docker/utils"
|
||||
)
|
||||
|
||||
@ -23,8 +24,7 @@ const (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if selfPath := utils.SelfPath(); strings.Contains(selfPath, ".dockerinit") {
|
||||
mainSysinit()
|
||||
if reexec.Init() {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user