Browse code

User os.Args[0] as name to reexec Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/02/22 08:32:50
Showing 1 changed files
... ...
@@ -219,7 +219,9 @@ func deletePidFile() error {
219 219
 // defined on the container's configuration and use the current binary as the init with the
220 220
 // args provided
221 221
 func createCommand(container *libcontainer.Container, console, logFile string, pipe uintptr, args []string) *exec.Cmd {
222
-	command := exec.Command("nsinit", append([]string{
222
+	// get our binary name so we can always reexec ourself
223
+	name := os.Args[0]
224
+	command := exec.Command(name, append([]string{
223 225
 		"-console", console,
224 226
 		"-pipe", fmt.Sprint(pipe),
225 227
 		"-log", logFile,