User os.Args[0] as name to reexec

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-02-21 15:32:50 -08:00
parent d40fbbb69b
commit e90b85bdc0

View file

@ -219,7 +219,9 @@ func deletePidFile() error {
// defined on the container's configuration and use the current binary as the init with the // defined on the container's configuration and use the current binary as the init with the
// args provided // args provided
func createCommand(container *libcontainer.Container, console, logFile string, pipe uintptr, args []string) *exec.Cmd { func createCommand(container *libcontainer.Container, console, logFile string, pipe uintptr, args []string) *exec.Cmd {
command := exec.Command("nsinit", append([]string{ // get our binary name so we can always reexec ourself
name := os.Args[0]
command := exec.Command(name, append([]string{
"-console", console, "-console", console,
"-pipe", fmt.Sprint(pipe), "-pipe", fmt.Sprint(pipe),
"-log", logFile, "-log", logFile,